1

I have an extension that needs to do a sendMessage in the content script to get some state information from the background script. Based on the results, the content script may or may not inject code into the page.

The problem I'm seeing is that the async nature of sendMessage is allowing code on the page to begin running before I can do my inject which in some cases, negates the point of the inject.

So like the title says, is there a way to block the page from loading just until sendMessage returns and I can make a yes or no injection decision? The content script is currently set to run at document_start.

yggba
  • 31
  • 2
  • 4

0 Answers0