Most active commenters
  • whatsthatabout(6)

46 points whatsthatabout | 17 comments | | HN request time: 1.271s | source | bottom

AutoPiP is a Safari extension that automatically enables Picture-in-Picture mode when switching tabs and disables it when returning to the video tab. No clicks needed - just seamless multitasking while watching videos.

Key features: • Automatic PiP activation when switching tabs • Smart detection for active videos only • Seamless disable on tab return • Zero configuration needed

GitHub: https://github.com/vordenken/AutoPiP

1. whatsthatabout ◴[] No.42254880[source]
As stated in the readme, this is my first coding project using Swift and Xcode. As a beginner, I welcome any help, suggestions, or contributions to improve the code and functionality!
replies(2): >>42258637 #>>42258894 #
2. cpressland ◴[] No.42258590[source]
This is amazing - I’ve not had a chance to test this yet but if it works as described then this is something I’ve been needing without realising it.

Hopefully you’ll be able to get this on the Mac App Store at some point, I’d gladly pay for this.

Edit: alternatively Homebrew / Nix.

3. CharlesW ◴[] No.42258637[source]
Nice work! As someone who's about to try their hand at their first Safari extension (and first web extension period, something in the spirit of Tabs Outliner), do you have any tips or tricks you could share?
replies(1): >>42259533 #
4. kelvinjps10 ◴[] No.42258859[source]
I thought this was the default for all browsers
replies(1): >>42258922 #
5. bsimpson ◴[] No.42258894[source]
I'm surprised to see native code in a web extension.
replies(1): >>42258952 #
6. ◴[] No.42258922[source]
7. dangus ◴[] No.42258952{3}[source]
Safari doesn’t use the same extension architecture as Chrome and Firefox.

https://developer.apple.com/documentation/SafariServices/saf...

replies(1): >>42259516 #
8. nosequel ◴[] No.42259208[source]
Amazon has prior art on AutoPIP
replies(2): >>42260436 #>>42261037 #
9. orenlindsey ◴[] No.42259247[source]
Just thought you might know - Apple added a new feature in the latest MacOS update that does the same thing. It's called Video Viewer and you can turn it on when a video is playing by clicking the icon that looks like the rectangle with two lines under it.

Yours is seamless and you don't have to turn it on every time, though.

replies(1): >>42259492 #
10. whatsthatabout ◴[] No.42259492[source]
Hey man, yeah I actually saw that! Before this I used another safari extension for it but I thought I could automate it - born was AutoPiP!
11. whatsthatabout ◴[] No.42259516{4}[source]
Thats true, but in the end the web extension itself can work with all browsers (if the apis are implemented of course). AutoPiP for example would work without any modifications in chrome/firefox but they implement their own PiP api so it doesn't activate the macOS native one...
12. whatsthatabout ◴[] No.42259533{3}[source]
I read a lot online and of course LLMs can probably help you there. I would suggest if it's nothing macOS/safari specific you want to build, start using chrome and develop the extension for it first. If you want to add safari to the list of supported browser later, you can easily adapt the code (as long as safari supports the apis for it).
13. zoover2020 ◴[] No.42260436[source]
DCMA'd before we know!
14. chalkycrimp ◴[] No.42261037[source]
I came here for this comment
15. ko3us ◴[] No.42264286[source]
Why do you need to have a lot of permissions for the extension?

This extension would be able to read and alter web pages and see your browsing history on this website. This could include sensitive information, including passwords, phone numbers and credit cards.

You can change this later in the Websites section of Safari Settings.

replies(1): >>42264916 #
16. whatsthatabout ◴[] No.42264916[source]
Hi, I added a part to the GitHub repo explaining this, basically its this:

- The extension requires permission to "Access all websites" solely to detect video players and enable Picture-in-Picture functionality across different websites

- No data is collected, stored, or shared with third parties

- All functionality operates locally on your device