Closed Bug 549693 Opened 14 years ago Closed 14 years ago

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

Categories

(Core :: IPC, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: stechz, Assigned: smaug)

Details

Attachments

(1 file)

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: nobody → Olli.Pettay
Summary: addMessageListener callback object should have access to browser object → [E10s] addMessageListener callback object should have access to browser object
Attached patch patchSplinter Review
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)
Attachment #429836 - Flags: review?(jst) → review+
http://hg.mozilla.org/projects/electrolysis/rev/025d95e9aa36
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: