No contextualIdentity events

NEW
Unassigned

Status

()

Toolkit
WebExtensions: Untriaged
P3
normal
3 months ago
11 days ago

People

(Reporter: andym, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [contextualIdentities], triaged)

MozReview Requests

()

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

Attachments

(1 attachment)

(Reporter)

Description

3 months ago
Currently I can query to find out details about a contextualIdentity, but I can't tell when they change in a webExtension. In my extension I list all the tabs and show the colour of a container. However if a user goes to "Manage containers" and changes the colour from yellow to orange... the WebExtension won't know without querying again.

The standard way to do this is some events like:

contextualIdentities.onCreated
contextualIdentities.onChanged
contextualIdentities.onRemoved

The extension can then addListeners if they'd like to find out when they change.

Updated

2 months ago
Priority: -- → P3
Whiteboard: [contextualIdentities] → [contextualIdentities], triaged
Blocks: 1191418
There isn't any implications in adding this is there?
This would be useful in other extensions outside the Test Pilot.
Flags: needinfo?(amarchesini)
Comment hidden (mozreview-request)
No particular issue. BTW, are they needed for Test Pilot?
Flags: needinfo?(amarchesini) → needinfo?(jkt)
No as we are in charge of all the creation points, so it's not needed. (if users have managed to add through the about:preferences panel then they have a bug as we disable it).
Flags: needinfo?(jkt)
Assuming I add a test or 5 does the current attached patch look ok?
Flags: needinfo?(amarchesini)

Comment 6

11 days ago
mozreview-review
Comment on attachment 8867511 [details]
Bug 1344519 - WIP patch for containers events

https://reviewboard.mozilla.org/r/139050/#review142600

::: toolkit/components/contextualidentity/ContextualIdentityService.jsm:175
(Diff revision 1)
>    },
>  
>    create(name, icon, color) {
> +    let userContextId = ++this._lastUserContextId;
>      let identity = {
> -      userContextId: ++this._lastUserContextId,
> +      userContextId: userContextId,

just: userContextId,
Attachment #8867511 - Flags: review?(amarchesini)

Comment 7

11 days ago
mozreview-review
Comment on attachment 8867511 [details]
Bug 1344519 - WIP patch for containers events

https://reviewboard.mozilla.org/r/139050/#review142602
Attachment #8867511 - Flags: review?(amarchesini) → review+
Yes, it looks correct. A test is needed, and also a proper review from a webextension peer.
Flags: needinfo?(amarchesini)
You need to log in before you can comment on or make changes to this bug.