Detect last opened page in a web browser and suggest to install the relevant package
e.g. if I've just opened https://code.visualstudio.com in Safari and then opened Overt, I would like it to have a button in an accessible place saying "Install Microsoft Visual Studio Code".
I wanted something like this for about 3 years already, but not enough to actually build a browser extension that does that.
The user should be able to disable this behavior, of course.
The only thing missing is to get the information about the opened page into Overt. I plan to research modern ways of doing this later, but a couple of ideas (for macOS):
- Using AppleScript and running it via a timer (like each 5 seconds):
tell application "Safari" to tell window 1 to tell current tab to get URL. Looks like the simplest solution. The energy impact of such a timer should be lower than a system clock, which is neglectable. - Having a browser extension linked with Overt, sending an event with the current tab URL each time it changes. A more elegant solution, but too complicated relative to its task.
- Having a helper app with accessibility access that uses some system API (if it exists, I did not look into that) to get the current tab URL. Not an elegant solution due to asking for accessibility access, and also too complicated.
Interesting idea! Thanks.
The AppleScript approach could even be run just once whenever the Overt window is re-focused. And I'm not sure this is possible at all (without a browser extension) on Windows, but would love to be proven wrong.
One concern would be how websites get mapped to packages. I suppose it would try to detect some prefix of the package's homepage URL? If so, perhaps this feature could be a Filter option called "Web browser" (or whatever) in the sidebar, so that if multiple packages happen to match, they could all be displayed? That's less of a good idea if conflicts are a really rare occurrence, though.