-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
yy
doesn't work on HTTP sites in Firefox
#4572
Comments
I'm also on Firefox 132.0.2 and Vimium 2.1.2 Edit: |
Ah ok, thanks though! I was pretty spooked out for a second there :) |
I took a quick look at the code and I feel like it might be a Firefox bug? Probably not though. But, it seems that Could it be that Vimium somehow has less privileges on HTTP sites or something? Any ideas? What do you think? |
From what I've seen in the code and the "toast-notification" in the bottom, the problem is not getting the URL. The URL is properly shown in the toast notification. The problem seems to be that it's not being copied to clipboard properly. I'm not super familiar with the code either though, so I can't really tell right now. What I've seen in the console when trying to
So something's definitely going wrong here. Maybe it is some kind of permission / security policy that prevents the relevant Vimium components to act properly. |
As you can tell, I'm quite ignorant :)
This I should have noticed though :)) Thanks a lot for taking a look!! |
So the relevant API that's causing the error is https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard However, I did try this in Chromium as well and it just worked with no error.
According to the Browser Compatibility table for the Permissions API, the feature https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#browser_compatibility |
Nice investigation @philg-dev. If there is no workaround, it would be nice if Vimium can show a warning in its heads up display rather than silently fail to write to the clipboard. |
Is the fact that |
From what I'm seeing in the code of this "fork", it looks like they're using a fallback mechanism to handle clipboard actions via the old and deprecated way I'm not very well versed in TypeScript yet, so the other project is pretty hard to read for me, so I might be wrong. https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard So it seems like theoretically we could also use this method, but the fact that it involves deprecated functions makes it seem like a pretty bad idea to implement a workaround like that. @philc I did implement a simple error handling that intercepts at the start of the central copy & paste functions that are used by all other Vimium actions related to the clipboard. I'm showing a HUD tooltip / toast notification for 2 seconds that just says: "Clipboard actions are unavailable on HTTP-only sites in your browser." I've tested it in Firefox and Chromium locally and it seems to work just fine. (Edit: in Chromium clipboard works on HTTP, it doesn't show the new error.) Edit: I've noticed that the tooltip is a bit too long to be fully displayed. If you have any feedback on what else it should say, feel free to let me know. |
- checking if navigator.clipboard is available - showing warning HUD message when clipboard unavailable - affects HTTP-only sites in non-Chromium browsers
To Reproduce
yy
Browser and Vimium version
Firefox 132.0.2
Vimium 2.1.2
The text was updated successfully, but these errors were encountered: