Messenger should require explicit filters

RESOLVED FIXED in Firefox 52

Status

()

Toolkit
WebExtensions: Untriaged
P3
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: robwu, Assigned: robwu)

Tracking

51 Branch
mozilla52
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 wontfix, firefox52 fixed)

Details

(Whiteboard: triaged)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Messenger in ExtensionUtils takes a `filter` parameter, seemingly to require senders to match the given filter.
Except that if the sender omits all fields, the message still gets delivered...

We need to distinguish between keys that are mandatory and keys that are optional.

(added blockers because the linked issue introduce new instances of Messenger)
Comment hidden (mozreview-request)

Updated

2 years ago
Priority: -- → P3
Whiteboard: triaged
Comment on attachment 8790157 [details]
Bug 1302020 - Add filter to Messenger + fix code documentation

https://reviewboard.mozilla.org/r/78110/#review78860

::: toolkit/components/extensions/Extension.jsm
(Diff revision 1)
>      if (uri) {
>        sender.url = uri.spec;
>      }
>      Management.emit("page-load", this, params, sender);
>  
> -    // Properties in |filter| must match those in the |recipient|

Why remove the comment?

::: toolkit/components/extensions/ExtensionContent.jsm:327
(Diff revision 1)
>      }
>  
>      let url = contentWindow.location.href;
>      // The |sender| parameter is passed directly to the extension.
>      let sender = {id: this.extension.uuid, frameId, url};
> -    // Properties in |filter| must match those in the |recipient|
> +    let filter = {extensionId: this.extension.id};

Same, why remove this?
Attachment #8790157 - Flags: review?(wmccloskey) → review+
(Assignee)

Comment 3

2 years ago
mozreview-review-reply
Comment on attachment 8790157 [details]
Bug 1302020 - Add filter to Messenger + fix code documentation

https://reviewboard.mozilla.org/r/78110/#review78860

> Why remove the comment?

Because it is already documented (in much more detail and with more precise phrasing) in Messenger.

Comment 4

2 years ago
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/98c3c114c936
Add filter to Messenger + fix code documentation r=billm

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/98c3c114c936
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Won't fix in 51 as this is not the feature shipped in 51.
status-firefox51: affected → wontfix
You need to log in before you can comment on or make changes to this bug.