Google Extension doesn't fire DOMContentLoaded, load or onload

111 Views Asked by At

I have a small project to change colour some text in any webpage. But whenever I use DOMContentLoaded, load or onload it's firing before all page loaded.

But when I use 'mousemove' listener it is working whenever I move my mouse after all page loaded.

Here is part of my manifest file to run my code;

"content_scripts": [
    {
        "matches": ["https://*.uipath.com/*"],
        "js": ["edit.js"],
        "run_at": "document_end"
    }
]

(Also tried run_at: document_idle, document_start but didn't work)

Here is listener part:

document.addEventListener("load", function(){
   // my code
})

I also checked readystate it is also not working, Because, page's state is turning complete before page is not loaded!

I checked readystate changing and all load listeners but it didn't work. Also tried all run_at options in manifest file.

0

There are 0 best solutions below