Closed Bug 1248344 Opened 9 years ago Closed 9 years ago

"addMessageListener" in frame scripts has stopped working in Nightly and Developer Edition

Categories

(Firefox :: Untriaged, defect)

46 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: webmaster, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0 Build ID: 20160214004015 Steps to reproduce: In a XUL add-on I can send messages from a frame script but I can't receive messages, it seems that "addMessageListener" is not working anymore... To reproduce, add the following code in overlay.js: window.messageManager.addMessageListener('addonid:getprefs', function (message) { console.log('message received in overlay.js'); message.target.messageManager.sendAsyncMessage('addonid:init', { prefs: {} }) }); window.addEventListener('load', function () { window.messageManager.loadFrameScript('path_of_frame-script.js', true) }, false); Add the following code in frame-script.js: addMessageListener('addonid:init', function (message) { console.log('message received in frame script') }); sendAsyncMessage('addonid:getprefs'); Start your browser and open the console, you will see that the message is not received in the frame script. You can confirm by opening more tabs.
OS: Unspecified → Windows 7
Hardware: Unspecified → x86_64
Could you attach a simple extension to reproduce the issue, please.
Flags: needinfo?(webmaster)
Sorry, I have just found that my issue was caused by a file named "strings.propertiies" (note the 2 "i")... There is no issue with "addMessageListener". Thanks Loic.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(webmaster)
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.