If you try to run: browser.tabs.sendMessage(tab.id, { text: "are_you_there_content_script?" }, function (msg) { msg = msg || {} if (msg.status !== 'yes') { chrome.scripting.executeScript({ ... }) } } ) In Chrome and Firefox, the function gets called no matter the response. In Safari, the function never runs because no script has been injected into the page so far. Always getting a response back, even if empty, undefined, or null, would make checking if scripts were injected much easier. This is useful to run executeScript only when asked for and only once, without managing a state with a variable by pushing and removing tabIds where it has run. Otherwise, people will add content scripts that always run - much heavier than executing scripts only when requested.
<rdar://problem/117614209>