Content Script doesn't execute even when loaded

I suspect I may have identified an AMO bug.

I have an content script that does not execute under the following circumstances, yet shows up in the sources in the developer tools:

  1. The initial installation

  2. Any time a new tab is opened by right clicking on a URL in a page and choosing to open in a new tab

  3. If the page/domain is opened by selecting from the Top Sites list.

It will execute when manually navigating to the page/domain by typing the URL in the address bar, or by choosing the page from bookmarks.

This behavior first began occurring a couple of months ago. There was no change to the content script when this began, so I suspect some kind of AMO event is not firing consistently across the different page access actions.

Additionally, for each of the cases listed above where it does not initially execute, if I wait a minute or two before clicking the page reload button, it will execute. If I try to reload immediately instead of waiting, nothing happens, almost as if there is a process that is being blocked until some internal timeout occurs.

I have an identical content script in Chrome and it functions perfectly.

I’m not sure if you’re talking about an issue on AMO or the WebExtensions API. Part of the problem might be due to content scripts being restricted on AMO, so they can’t run there. Anything outside of that would be a bug in the API, and I suggest you file it here.