browser.runtime.sendMessage() messages emitted by background script not passed to listeners in same script

RESOLVED DUPLICATE of bug 1286124

Status

WebExtensions
General
RESOLVED DUPLICATE of bug 1286124
2 years ago
29 days ago

People

(Reporter: Abhishek, Unassigned)

Tracking

51 Branch

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20170118123726

Steps to reproduce:

browser.runtime.onMessage.addListener(function(msg){console.log("whoa!");});
browser.runtime.sendMessage(msg);

This is the code from a background script of a web extension. Used to work correctly before the new firefox update.


Actual results:

The listener callback never gets called . sendmessage fails with error "Error: Could not establish connection. Receiving end does not exist."


Expected results:

The listener callback should have been called.
User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0

Hi Abhishek. 

Please, can you provide the web extension so we can take a look at the error? 

Also, I will assign a component and perhaps there's someone with extensive knowledge on this area that might be able to help here.
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit

Updated

2 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1286124

Updated

29 days ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.