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

Confirmed Issue #9594305


Wladimir P.
Oct 30, 2016
This issue is public.
Found in
  • Microsoft Edge
Found in build #
Reported by 6 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.”

  • This problem also occurs when the content script is injected by the event handler of an browserAction. After loading or reenabling of an extension the icon of the browserAction appears, but when you click it, the injecting of the content script fails. After a page reload it works. It also works on other tabs that are loaded later.

    Maybe this problem only appears with locally loaded extensions but not with extension loaded from the Microsoft Store.

    If it helps, I could attach a simple example extension to reproduce this problem.

  • Microsoft Edge Team

    Changed Status to “Confirmed”

  • Hello,

    Thank you for providing this information about the issue. We are presently tracking this issue as a duplicate of an existing internal bug report. We look forward to additional feedback you may have on how we can improve Microsoft Edge.

    Best Wishes,
    The MS Edge Team

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

Sign in