If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

[E10s] addMessageListener callback object should have access to browser object

RESOLVED FIXED

Status

()

Core
IPC
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: stechz, Assigned: smaug)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

8 years ago
If addMessageListener is given an object, i.e. { receiveMessage: function() {} } its this pointer should point to that object, and its message parameter should have a "target" member that points to the browser element.

For callback functions passed to addMessageListener, the this object should be messageManager and the message parameter should also have a target member.
(Assignee)

Updated

8 years ago
Assignee: nobody → Olli.Pettay
(Assignee)

Updated

8 years ago
Summary: addMessageListener callback object should have access to browser object → [E10s] addMessageListener callback object should have access to browser object
(Assignee)

Comment 1

8 years ago
Created attachment 429836 [details] [diff] [review]
patch

This adds .target to the message and changes 'this' handling to be closer to
event handlers:
  if messageManager.addMessageListener("foo", function() {}) is used, then
  'this' is the messageManager.

  if messageManager.addMessageListener("foo", {receiveMessage: function() {}})
  is used, then this is the object.
Attachment #429836 - Flags: review?(jst)

Updated

8 years ago
Attachment #429836 - Flags: review?(jst) → review+
(Assignee)

Comment 2

8 years ago
http://hg.mozilla.org/projects/electrolysis/rev/025d95e9aa36
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.