How to run a user script after loading the page #119
marco-eckstein
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
The script is run before the page is parsed in fact. To fix the issue, you can listen to the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is the option
browser-script
, described as "Path of a script executed in the page (and all the frames) before it is loaded". Indeed, my script (JavaScript) is apparently not run after the page has loaded. I don't know what "executed before it is loaded" even means. However, using a little trick still allows me to execute code after the page has loaded. E.g. for YouTube, I do this:The callback only reaches its last line if both
document
andelement
are available.Note that there is the option
user-script-enabled
, which is true by default and described as "Enable the event API allowing to execute scripts before the page is saved". So maybe there is a more straightforward way to run a user script after loading the page, but I couldn't find it.Beta Was this translation helpful? Give feedback.
All reactions