My question is about the order (the sequence) that the script files run.
I call a script file named "aaa.js" and as callback of the executeScript I have the file script "bbb.js", like shown is the following sketch code:
chrome.tabs.executeScript(tabid, {file:"aaa.js", runAt: 'document_start' },
function() {
chrome.tabs.executeScript(tabid, {file:"bbb.js", runAt: 'document_start' });
}
);
Theoretically, the "bbb.js" file executes only after the "aaa.js" finishes.
Since the "aaa.js" uses several instances of image.onload = function(){...}, and the management of the onload event handler is asynchronous, my question is:
Are all tasks (that are been put in queue, related with to asynchronous behavior of the "aaa.js") fully concluded, before the execution of the "bbb.js"?