Skip to content
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

The userscript sometimes does not load (Firefox + ViolentMonkey + Linux) #3

Closed
hardpenguin opened this issue Nov 7, 2023 · 7 comments

Comments

@hardpenguin
Copy link

Like in the description, the userscript sometimes does not load. It happens, I don't know, less than 50% of the time I load Twitter in my browser tab? What often helps (but not always) is performing a forced reload/refresh (CTRL+F5) of the tab.

The very latest stable versions of the userscript (0.11), Firefox (119.0), and ViolentMonkey (2.16.0) were used. Not sure how to debug this? Happy to follow any debugging steps if you're willing to do that together.

I believe this is the error message from the developer console:

Content Security Policy: The page's settings blocked the loading of a resource „inline” („script-src”).

Which in turn led me to the debugger output (attached).
debugger_output.txt

I did some digging and I suspect this might be related (I might be wrong though, I don't know a first thing about modern web development): violentmonkey/violentmonkey#173

@hardpenguin
Copy link
Author

hardpenguin commented Nov 7, 2023

Hold your horses with the reply, I am testing changing the userscript @inject-into setting to "auto" in ViolentMonkey... So far so good... I'll let you know

@59de44955ebd
Copy link
Owner

I already had exactly the same issues with Firefox in Windows, sometimes it loads, sometimes not. What seemed to help is a forced reload (e.g. by holding the Shift-Key), but of course that's not really a solution. But this issue only occurs with Violentmonkey, not with Greasemonkey, which is why I for now use Greasemonkey in Firefox instead.

@59de44955ebd
Copy link
Owner

ps: a couple of days ago I had spent half a day for finding a workaround for this Violentmonkey-Firefox-CSP issue, unfortunately without success. It smells like some bug in Violentmonkey, since as mentioned it never occurs in Greasemonkey in the same browser.

@59de44955ebd
Copy link
Owner

pps: I forgot to mention, "@inject-into auto" would disable the ability to "hook" into Twitter's XMLHttpRequest calls, which is needed to support "Cards" in Bluesky (in Bluesky they have to be created on the client side, whereas in Mastodon the server/instance/endpoint takes care of it). But yes, if you only use Mastodon anyway, this should fix the issue.

@hardpenguin
Copy link
Author

I see! Thanks for all the details. It looks like that setting fixed the issue for me. Yeah it is frustrating because some userscripts work better in Tampermonkey, other in Violentmonkey etc. (Greasemonkey is not recommended because it has not been updated in 3 years).

Feel free to close this issue if you feel this solves it, at least for now.

@59de44955ebd
Copy link
Owner

Oops, my bad! When I wrote "Greasemonkey" above I actually always meant "Tampermonkey" - I don't have this old Greasemonkey installed anywhere. It's just too many monkeys, that's why I got a little confused :-)

@59de44955ebd
Copy link
Owner

FYI, I know added this as "Known limitation" to the README and closed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants