-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Improvements for GreaseMonkey support #3238
Comments
If anyone is thinking about using webchannels, I have a branch you can steal from where I started to work on this (to support follow_selected a while back) but I trashed it because it was not needed. |
Also support regular expressions in |
Known broken scripts:
|
I have found an issue with a script I made: // ==UserScript==
// @name Kill subreddit style
// @description Unload all subreddits custom stylesheets
// @author rnhmjoj
// @include https://old.reddit.com/r/*
// @version 1.0.0
// @run-at document-start
// @grant none
// ==/UserScript==
for(var link of document.getElementsByTagName("link")) {
if(link.title == "applied_subreddit_stylesheet")
link.disabled = true;
} The script doesn't work because |
That's just because it is running too early before those elements have been added. Try changing the |
Ah, thank you! it's working. This used to work with violentmonkey... is it just slower to load the scripts then? |
Oh that's interesting, and annoying. QtWebEngine handles the events for us so maybe that gets access to earlier triggers than extensions do. |
The Greasemonkey wiki says that only FWIW the document.readyState docs say "We can now access the DOM elements." for the In other words, I think this is fine, and your script should use edit: Oh, just found the Violentmonkey docs which say:
|
Don't know if I should be this here , but I made a script for Trello's plugin that add cost to task that display the total cost for a list. It works fine on Chrome but it seems to have a conflict with newrelic.js in qutebroser :
The rewrelic.js line :
My script link is : Don't know if there is anything I can try to fix it :/ Thx again for this awesome browser ! |
Yeah that looks like they are shadowing the browser's `Proxy`
implementation. Since you are only modifying the DOM (as opposed to
talking to and trello JS API object) you should be able to run it in a
different JS world to isolate it from that. Add this line to the
metadata (see #4017 for more info):
```
// @qute-js-world jseval
```
|
|
Does |
@amacfie I think so - why are you asking? |
It would be nice if there was a setting to enable/disable the loading of GreaseMonkey scripts. Sometimes I will encounter odd behavior on a page which I suspect may be related to one of my scripts and would like to quickly check if the page functions correctly without them. Right now I append |
Similarly to what @LiteracyFanatic already mentioned, I think it'd be great to have |
Any good news for cross-origin GM_xmlhttpRequest? |
@Ninlives no good news sorry. None on the horizon either. |
Just leaving this comment to upvote implementing Do you think there is any workaround in the meantime? For example, reading a local file in config.py, and setting a variable which could be read from the greasemonkey script? Thanks |
The obvious workaround is to include your resource in your JS file. Other than that, no. There's no way for Greasemonkey to access Python stuff, see the comment just above yours. |
Things which could be improved after #3040 is in:
.user.js
file is opened, like Chromium@require
(maybe without the downloading, but at least load those files if they exist?)scriptHandler
andversion
then for GM_info?isPrivate
in GM_info.@noframes
sometimes doesn't work with QtWebEngine / QWebEngineScriptGM_registerMenuCommand
somehowCan we set the injection point correctly for a Qt 5.8+ QtWebEngine?(my bad, Qt already does this based on the userscript comment)run-at
shouldn't show an error?@match
@qute-js-world
to request the script be ran in a non-default javascript "world"@inject-into
https://violentmonkey.github.io/posts/inject-into-context/GM_getResourceText
(Wanikani Niai Similar Kanji called unimplemented GM_getResourceText #3975)@grant unsafeWindow
to useunsafeWindow
@requires
directives, without requiring the use of thefile://
protocol (from Greasemonkey scripts: Local file improvements #6458)GM_setValue
with non-primitive values (see Improve some Greasemonkey API stubs #6699)@qute-js-world
cc @toofar
The text was updated successfully, but these errors were encountered: