browser.tabs.executeScript() fails with "unknown error" for pages that loaded "too early"

Issue #9594305 • Assigned to Scott S.


Wladimir P.
Oct 30, 2016
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Reported by 2 people

Sign in to watch or report this issue.

Steps to reproduce

  1. Unpack the attached ZIP file and load it as an extension in Edge.
  2. Restart Edge.
  3. Load in the active tab.
  4. Allow extensions from untrusted sources to load and wait a little for the message to appear (dismiss it).
  5. Reload “executeScript test” extension and wait a little for the message to appear (dismiss it).
  6. Reload and repeat step 5.

Expected results

A message “Content script running!” appears after steps 4, 5 and 6 - the extension always succeeds injecting its content script into the page.

Actual results

The message “Failed executing script: Unknown error” appears after steps 4 and 5 - browser.tabs.executeScript() always fails with browser.runtime.lastError being “Unknown error” for pages that loaded before extensions were allowed. Only after step 6 you get the expected “Content script running!” message - the page was reloaded and became accessible to extensions now.


1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

    Changed Assigned To from “Brad E.” to “Scott S.”

You need to sign in to your Microsoft account to add a comment.

Sign in