4 ms·
Doesn't setting "run_at":"document_start" allow the content script to run before any of the page's scripts? All of those ways that you mentioned that a web-page
by AgentME 9y ago
Doesn't setting "run_at":"document_start" allow the content script to run before any of the page's scripts? All of those ways that you mentioned that a web-page could booby-trap its javascript context could be done by an extension first.
>+ Use variables or functions defined by their extension's pages
>+ Use variables or functions defined by web pages or by other content scripts
Those are just consequences of the content script not running in the same javascript context. If it ran in the same context, then the web page javascript could access private extension APIs or otherwise break content script code. If you actually want to interact with the page's variables, there's ways to do that.