Closed Bug 1302020 Opened 8 years ago Closed 8 years ago

Messenger should require explicit filters

Categories

(WebExtensions :: Untriaged, defect, P3)

51 Branch
defect

Tracking

(firefox51 wontfix, firefox52 fixed)

RESOLVED FIXED
mozilla52
Tracking Status
firefox51 --- wontfix
firefox52 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: triaged)

Attachments

(1 file)

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)
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+
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.
Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/98c3c114c936
Add filter to Messenger + fix code documentation r=billm
https://hg.mozilla.org/mozilla-central/rev/98c3c114c936
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Won't fix in 51 as this is not the feature shipped in 51.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: