Unable to get property 'onMessage' of undefined or null reference in Edge extension content script

Not reproducible Issue #9823671


Stefan M.
Nov 16, 2016
This issue is public.
Found in
  • Microsoft Edge
Reported by 3 people

Sign in to watch or report this issue.

Steps to reproduce

I’m converting an Chrome extension which works well to Edge extension, and I need to have message listener in my content script.

Here is the code in my content script:


function listener(message) {

However, each time script executes, I get this error, pointing to first line of my content script code:

Unable to get property ‘onMessage’ of undefined or null reference

I’ve tried changing browser.runtime into chrome.runtime, but nothing changes.

Here I’ve found that Edge supports runtime.onMessage with some minor incompatibilities:



1 attachment

Comments and activity

  • Microsoft Edge Team

    Changed Assigned To to “Brad E.”

    Changed Assigned To from “Brad E.” to “Akshay P.”

    Changed Assigned To from “Akshay P.” to “Snehita P.”

    Changed Status to “Confirmed”

    Changed Status from “Confirmed” to “Not reproducible”

  • Tried with the code (mentioned in repro steps) in content script and the scenario worked. Attached sample extension used for testing.

  • Microsoft Edge Team

    Changed Assigned To to “Arif S.”

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

Sign in