My web page uses my extension which has event-script and content-script. In what order are the three executed?
My web page depends on content-script being available on window.load and my content-script depends on my event-script being available and ready for use. Can I assume the following order of execution for my scripts:
- First, my event-script is loaded, it connects to a native host application and it registers chrome.runtime.onConnect listener for messages from content-script
- Second, my content-script is loaded and it connects to event-script using chrome.runtime.connect, it also adds window.onmessage listener to receive messages form web page
- Last, on my web page in window.onload event I start to send a messages to content script using window.post and get response via window.onmessage