I have a Chrome+Mozilla web extension, Requestly. I load two content scripts for a particular page with the following declaration in manifest
"matches": [ "*://requestly.in/rules/*" ],
"css": [ "generated/pages/css/main.css" ],
"js": [ "generated/pages/js/libs.js", "generated/pages/js/main.js" ]
With this declaration, I assumed main.js should be executed after libs.js is executed because main.js is dependent on libs.js
libs.js contain libraries
main.js contain app specific code
But I am getting an error on the page saying 'taostr' is undefined which is defined in libs.js and used in main.js
I put console logs at the beginning and end of both the scripts to ensure the order of execution and I found a strange behavior.
Here is the screenshot showing the execution is either parallel or out of order.
Can you please confirm what I expect is wrong or not ? Why did main.js started execution first even before libs.js has not started ?
This used to work before Firefox v52.