-
Notifications
You must be signed in to change notification settings - Fork 898
Copy URL to clipboard from Chromium apps #1458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Copy URL to clipboard from Chromium apps #1458
Conversation
0955a84
to
debfe8c
Compare
I just pushed an update to this PR, it is now wrapped in the launcher for web apps. Unfortunately it isn't consistently working yet. If you kill all Chromium sessions it works, but if there is still a session active it won't. |
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
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. |
config/chromium-flags.conf
Outdated
@@ -1,3 +1,4 @@ | |||
--ozone-platform=wayland | |||
--ozone-platform-hint=wayland | |||
--enable-features=TouchpadOverscrollHistoryNavigation | |||
--load-extension=$HOME/.local/share/omarchy/applications/chromium/copy-url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if we could use "~/.local/share/omarchy/applications/chromium/copy-url" and then could totally avoid the $HOME changes in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hjanuschka nice! This works.
I had tried $HOME which doesn't work. But ~ works fine, great suggestion. I dropped the change to the update script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hjanuschka can you give it a try?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it works for me! :) but i had to change the shortcut, as my customized conf + german macbook keyboard
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for testing. I added a little explanation to the commit to make it clear you can change it.
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
I just rebased this pull request with |
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+U
the 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.