solomkinmv / hotkys

Collection of useful shortcuts for different applications
https://hotkys.com/
MIT License
7 stars 4 forks source link

Make Raycast "List current shortcuts" work for web apps #80

Open th0rgall opened 2 weeks ago

th0rgall commented 2 weeks ago

I wanted to log an idea here. The "List current shortcuts" is very useful for desktop apps, but currently doesn't work for web apps.

Some apps in Hotkys are already web apps, like Fastmail, I think it would be helpful to add more web apps like Google Drive and more in the future (still with the macOS focus for now, considering #2).

I see two ways to make this work:

1. Figuring out the URL of the current browser tab in Raycast

It seems like this is possible. This Raycast extension advertises that it can get the current URL of the current browser tab: https://github.com/raycast/extensions/tree/3daae018d69bed4ab346b2e3c94d09fa5ad0fc86/extensions/copy-path/

Preferably, this should work across all Chromium-based browsers on macOS, and Firefox too.

Additionally, we would need to add a property like {"appUrl": "https://fastmail.com"} to app definitions, to be able figure out which shortcuts to show.

2. Making a Hotkys browser extension

... based on the same data as the website and Raycast extension.

The only reason why a web extension might be nice, is that it would be relatively straightforward to build a "List current shortcuts" feature, since web extensions can trivially get the window URL of the current tab.

This extension could then surface a Raycast-like search overlay on any supported web app using a content script. It could be mapped to Cmd+Shift+K, or something else (configurable) in the browser itself.

This option seems less interesting while the Raycast extension could just be made more powerful; however, if Windows/Linux ever becomes a supported platform, this might become a viable alternative for those platforms.

solomkinmv commented 2 weeks ago

Yeah, I'm sure it's possible to do this via Raycast. I even have it in my backlog. One more requirement for this feature would be support of PWAs. Also, extension needs to distinguish if user wants shortcuts for the web app or browser itself. The easiest way would be adding one more command specifically for web apps.

I can try adding website detection this weekend and we'll see how it goes!

As for the browser extension it may be possible if there's a demand. So far, I would focus on Raycast as a nice and easy way to interact with Mac OS and environment.