I am having some problem with the order of javascript execution when I use the content script to inject some javascript into the HTML page:
This is my HTML page I us
When you inject javascript onto the page like that, it comes in asynchronously. When you actually have the tag in there from the beginning, it will be synchronous and run in the correct order.
Kind of a hassle, but since it's asynchronous, your code will continue to execute while the other script file is being loaded.
In order to know when the script is complete, you have to handle the event for the script - easiest way is using jQuery's getScript
function, which provides you a callback argument.