Passing Chrome content script parameters without asynchronous calls

47 Views Asked by At

I have a content script (configured with document_start) which is injecting code into the current page, in order to overwrite/proxy existing objects.

So far, so good, that seems to work just fine and the content script code is executed before any Javascript on the page itself. The problem is the injected code should be configurable and there I only have the option between messaging and local storage, both of which uses callbacks and that "forced" asynchronism executes the callback function at some point after the page's Javascript.

Is there any way to have code injected via a content script configurable and still executed before any code from the currently open page?

0

There are 0 best solutions below