-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
User scripts don't work on certain pages like Github #569
Comments
Unfortunately this is an error with the content security policy (you can see an error in the console when you run the script through Gesturefy). This is similar to #258 More info about this bug can be found here: |
I see. Are there any other notable sites (besides official Mozilla sites) where user scripts do not work? |
The only one I know about (besides github) is twitter. |
Thanks, I can also confirm it does not work there. Perhaps a list can be made for such websites, just so everyone is aware, unless the list is really, really small. Edit: A bit off topic, but I would like to say thank you guys for figuring out a workaround for hotkeys on here (wheel gestures and rocker gestures), since I believe Firefox restricts a lot of keyboard functionality. Perhaps more mouse buttons can be added, though? Such as if a mouse had 10 mouse side mouse buttons, would that be possible? |
I agree. I've already searched for such a list, since this affects most of the user script managers like tampermonkey, but I couldn't find anything. As a workaround you can also completely disable the CSP as described here: #258 (comment) but I personally wouldn't recommend that.
In theory one should be able to detect the so often called "back and forward" buttons too. However it doesn't work on my end, maybe it does on yours? You may test this with this fiddle (not made by me). It should output some information whenever a mouse button is clicked. |
I couldn't get forward or back to work either.
Could you perhaps explain why? Security reasons or other? |
Yes, I'm not an expert on CSP, but it can prevent cross site scripting attacks, which however should already be prevented beforehand. So it's just another line of defense. If somehow the website programmers forgot to sanitize some user input text and this finds its way back to the website this will still prevent XSS attacks. So it's not necessary but can be helpful. MDN is always a good source if you want to learn more :) |
If I create a simple usersciprt like
and install it into Violentmonkey, it runs on CSP-protected pages just fine (and logs a Since it works for VM, would it be possible for Gesturefy to use the same approach, or is it still too insecure/too dirty of a hack/... ? |
I'm somewhat reluctant to run user scripts as direct content scripts for security reasons (reviewers also may decline this working principle for an extension that is mainly focused around mouse gestures). One could endlessly argue about this, since user scripts are an advanced feature the users should know what they are doing, but on the other hand a lot of people just trust others and copy & paste others code. I would like to use Firefox's userScripts api, but it can only execute scripts by domain/patterns and not in a specific tab. I already made a feature request on bugzilla for this a while ago. Btw with the upcoming manifest 3 running arbitrary code (user scripts) as content scripts or page scripts (which is what Gesturefy currently does) won't be possible any more for security reasons. That's why I already raised my voice for an appropriate API: |
Describe your matter in detail
Your System
The text was updated successfully, but these errors were encountered: