Copy URL to clipboard from Chromium apps#1458
Conversation
0955a84 to
debfe8c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
guess chromium needs atleast one full restart?! |
My solution works when you don't have any other Chromium open, so it has to be the first. Right now I'm working on making a .crx, which should work. |
|
i wonder if we should just patch chromium to have a global hotkey 🤨 |
Is that easier to do? I think this extension could work. |
|
shouldn't be that hard, extension for me feels a bit heavy, but well on the otherside if we can ship it so that it works reliable so your PR works if the first chromium that launches has the config to load the extension? |
Shipping it to the store is the easiest, but the disadvantage is that this is also an attack vector that could be exploited, if someone overwrites the extension (through my account) they could compromise the browser. That's why I started with making the extension locally. The flag I'll try to make some time this weekend. Just got back from the conference. |
|
cant we somehow download it and verify the hash? to protect against tempered extension?
yes this is because there can only be one i nstance running, we could add --load-extension= to https://github.com/basecamp/omarchy/blob/master/config/chromium-flags.conf so no matter how chromium is started it gets the flags |
|
Thanks for the pointer! I'll take a look at it tomorrow. |
16919f8 to
d009947
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
so - i am not the one deciding to merge (cc @dhh ) - but overall this looks good to me. i would like to rename the extension to "omarchy" - and keep it as a place for further stuff - and not making it explicitly only for copy of url. |
9604f43 to
7561714
Compare
|
I'm digging this! But let's use |
Nice to hear that you like it, I agree with your suggestions. However there are two minor "issues";
What do you think? |
7561714 to
cdad7a9
Compare
|
@dhh I just pushed an update to this branch. I went with |
06e2205 to
b64f284
Compare
In Omarchy web apps it's impossible to get the curent URL to share it in another applications. This commit adds a browser extension which is included by default via the chromium-flags.conf config. With this extension you can get the current URL via a keyboard shortcut. The default shortcut for getting the current URL is `Ctrl+Shift+L`, this shortcut can be changed via this page: chrome://extensions/shortcuts.
b64f284 to
d972704
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
Hmm, I can get this to load, but the hotkey is not getting picked up. Ctrl + Shift + L doesn't do anything. I checked that the extension is loaded, and it is. But yeah, no hotkey is exposed. Not in chromium itself, not in the webapps. |
In my testing and research I found out that not all shortcuts are available as suggested_key. We still want to use L because that's easy to remember because we associate it with the location bar.
|
Moving it to Alt + Shift + L worked 👌 |
Better mirrors Ctrl + L as well
|
@dhh ah, you noticed my changed. :-) I just asked some friends to test it. I'm glad it now works on your machine too. |
This comment was marked as outdated.
This comment was marked as outdated.
|
I had Alt + L working, but then I couldn't get it working again?? It refused to allow anything but Alt + Shift + L. |
* Copy current URL to clipboard with browser extension In Omarchy web apps it's impossible to get the curent URL to share it in another applications. This commit adds a browser extension which is included by default via the chromium-flags.conf config. With this extension you can get the current URL via a keyboard shortcut. The default shortcut for getting the current URL is `Ctrl+Shift+L`, this shortcut can be changed via this page: chrome://extensions/shortcuts. * Change the shortcut to Alt+Shift+L In my testing and research I found out that not all shortcuts are available as suggested_key. We still want to use L because that's easy to remember because we associate it with the location bar. * Improve notification language * Move it to just Alt + L since that's not used Better mirrors Ctrl + L as well * Move this under default/chromium * Fix symlink * It didn't like Alt+L alone after all --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
* Copy current URL to clipboard with browser extension In Omarchy web apps it's impossible to get the curent URL to share it in another applications. This commit adds a browser extension which is included by default via the chromium-flags.conf config. With this extension you can get the current URL via a keyboard shortcut. The default shortcut for getting the current URL is `Ctrl+Shift+L`, this shortcut can be changed via this page: chrome://extensions/shortcuts. * Change the shortcut to Alt+Shift+L In my testing and research I found out that not all shortcuts are available as suggested_key. We still want to use L because that's easy to remember because we associate it with the location bar. * Improve notification language * Move it to just Alt + L since that's not used Better mirrors Ctrl + L as well * Move this under default/chromium * Fix symlink * It didn't like Alt+L alone after all --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
* Copy current URL to clipboard with browser extension In Omarchy web apps it's impossible to get the curent URL to share it in another applications. This commit adds a browser extension which is included by default via the chromium-flags.conf config. With this extension you can get the current URL via a keyboard shortcut. The default shortcut for getting the current URL is `Ctrl+Shift+L`, this shortcut can be changed via this page: chrome://extensions/shortcuts. * Change the shortcut to Alt+Shift+L In my testing and research I found out that not all shortcuts are available as suggested_key. We still want to use L because that's easy to remember because we associate it with the location bar. * Improve notification language * Move it to just Alt + L since that's not used Better mirrors Ctrl + L as well * Move this under default/chromium * Fix symlink * It didn't like Alt+L alone after all --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
* Copy current URL to clipboard with browser extension In Omarchy web apps it's impossible to get the curent URL to share it in another applications. This commit adds a browser extension which is included by default via the chromium-flags.conf config. With this extension you can get the current URL via a keyboard shortcut. The default shortcut for getting the current URL is `Ctrl+Shift+L`, this shortcut can be changed via this page: chrome://extensions/shortcuts. * Change the shortcut to Alt+Shift+L In my testing and research I found out that not all shortcuts are available as suggested_key. We still want to use L because that's easy to remember because we associate it with the location bar. * Improve notification language * Move it to just Alt + L since that's not used Better mirrors Ctrl + L as well * Move this under default/chromium * Fix symlink * It didn't like Alt+L alone after all --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>

This afternoon I was at Rails World, talking to @dhh, I was asking if there is a way to copy the current URL to the clipboard with a Omarchy web application. We came up with an idea to use a Chrome extension that would be bundled with Omarchy. In this PR there is a bundled Chrome extension that is loaded via the
/config/chromium-flags.conf.Below in the screenshot you'll see an example of how it works. I'm browsing with the preinstalled HEY application, when I press
ALT+SHIFT+Uthe current URL is on my clipboard and I see a small notification.How to test:
You should see this:
Then start a chromium browser, et voila.