Here is my problem: I am making an extension for an existing website.
the site loads two javascript files when the page is loaded:
foo.js
bar.js
foo.js defines variable X and assigns it a value of 1.
bar.js then goes on to reference variable X, and uses that value in it's own script.
I want to assign my own value to variable X.
My problem is that the extension can only run at document_start or document_end. if I try to change the value of variable X by running the script at document_start, the site loads foo.js and overwrites my variable back to 1 when it's loading all of the site resources. If I change variable X in document_end it won't help because bar.js already used the value from variable X way before my extension was executed.
Suppose I ran my extension at document_start. If I could allow foo.js to load, but STOP bar.js from loading, assign my custom value to variable X, AND ONLY THEN request bar.js again and have it excecute it's code, my problem would be solved. Is this possible?