Open ZhangWei55kai opened 3 months ago
The reason your script always waits for the page to fully load is because you're using window.onload
. You can check out more details here: MDN: Window Load Event. Basically, the window.load
event fires after the whole page, including all the styles, scripts, images, etc., has loaded.
So while you're telling the extension to run the code before the page loads, your script is actually telling Chrome to hold off until everything's fully loaded. LOL
Just move everything out of window.onload = function() {}
and it should work
Describe the bug A clear and concise description of what the bug is.
My goal is simple. I hope to execute the JavaScript I have pre-set in the browser before opening the page. However, the current situation is that I have to wait for the page to load before executing the custom JavaScript, which takes a very long time and does not meet my expectations