Add <browser>.messageManager property

RESOLVED FIXED in mozilla2.0b8

Status

()

Toolkit
XUL Widgets
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: bsmedberg, Assigned: mfinkle)

Tracking

({dev-doc-complete})

unspecified
mozilla2.0b8
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [e10s])

Attachments

(2 attachments)

(Reporter)

Description

7 years ago
I was editing message-manager docs and found that <browser>.messageManager is only implemented in Fennec, not in the core bindings. Since we're encouraging extension authors to start using the message manager now in Firefox, we should make that property available.
Created attachment 492426 [details] [diff] [review]
patch

As Benjamin states, this property is active in Firefox 4, so it will work fine. Once this lands, I can remove the same property from the Fennec extended binding.
Assignee: nobody → mark.finkle
Attachment #492426 - Flags: review?(gavin.sharp)
(Reporter)

Comment 2

7 years ago
I was going to write a test, too. I know things are all loosey-goosey in mobile-land, but I'd really like to make sure this actually works.
(In reply to comment #2)
> I was going to write a test, too. I know things are all loosey-goosey in
> mobile-land, but I'd really like to make sure this actually works.

Yeah, none of our current tests would pass if this failed. I guess browser-chrome would work. A small test would be easy for me to add.
Comment on attachment 492426 [details] [diff] [review]
patch

r=me with a test added. I'm not exactly clear on what this can be used for by extensions in Firefox 4, and I suppose a test would help with that (and also be useful for documentation purposes).
Attachment #492426 - Flags: review?(gavin.sharp) → review+
We might want to mirror it on tabbrowser as well (as we do with other browser properties like currentURI).
Keywords: dev-doc-needed
OS: Windows 7 → All
Hardware: x86 → All
(Reporter)

Comment 6

7 years ago
I don't *think* we want to expose it on the tabbrowser. If you want to attach a behavior to all loaded tabs you want window.messageManager, not <browser>.messageManager.
tabbrowser mirrors many of the properties of its selected <browser> for convenience (tabbrowser.currentURI, .docShell, .webProgress, .contentDocument, etc.) It's probably more confusing than it is convenient, though, so I don't mind not extending that pattern for this case.
(Reporter)

Comment 8

7 years ago
Created attachment 495829 [details] [diff] [review]
With tests
Attachment #495829 - Flags: approval2.0+
(Reporter)

Updated

7 years ago
Attachment #495829 - Attachment is patch: true
Attachment #495829 - Attachment mime type: application/octet-stream → text/plain
(Reporter)

Comment 9

7 years ago
http://hg.mozilla.org/mozilla-central/rev/7de7681aa6d3
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Reporter)

Updated

7 years ago
Target Milestone: --- → mozilla2.0b8
Whiteboard: [e10s]
Updated documentation:

https://developer.mozilla.org/en/The_message_manager
https://developer.mozilla.org/en/XUL/browser
https://developer.mozilla.org/en/XUL/Property/messageManager
https://developer.mozilla.org/en/DOM/window
https://developer.mozilla.org/en/DOM/window.messageManager

This should be done now.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.