I'm developing a chrome extension that needs to block the load of the html page, do some validations on the javascript, that cames in the page, in my content script, and proceed(or not) with the loading of the page.
In my manifest with "run_at": "document_start", the content scrip get a empty html and can't do the validation. With run_at at document_end, it alredy executed js that comes in the page, and just after that my extension does the validation of it...
Is there a way to set like a DOMContentBeforeLoad in my content script or something? I'm really out of options..
Thanks
I think to do what you are doing you are going to have to do what you did with document_start, then load the html page via an ajax call and parse it yourself.
The browsers typically don't load all the scripts and then execute them, this happens asynchronously in the order of the page, so there isn't a point you can catch it at where the javascript will have loaded but nothing will have executed (unless you control the content of the page as well).