Closed Bug 1362928 Opened 7 years ago Closed 7 years ago

Calling browser.contextualIdentities.query({}) multiple times results in undefined contextual Identity objects

Categories

(WebExtensions :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: mrdokenny, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: investigating)

Attachments

(2 files, 1 obsolete file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0
Build ID: 20170507030205

Steps to reproduce:

Install Cookie AutoDelete

Turn on "Enable Support for Firefox's Contextual Identities" in the options.

Try a Cookie Cleanup in the popup. 


Actual results:

Cookie Cleanup results in errors because it needs the cookieStoreId from browser.contextualIdentities.query({}) to be passed into browser.cookies.remove(), but it is undefined in Firefox 55. See screenshot.


Expected results:

Cookie cleanup should have completed with a notification. One workaround I had to do was cache the contextualIdentities objects so I wouldn't have to call browser.contextualIdentities.query({}) over and over. Also, that extension with "Enable Support for Firefox's Contextual Identities" enabled works fine in 53-54. I think it must be bug 1350522, since that's the only change I see from: 

https://hg.mozilla.org/mozilla-central/filelog/17d8a1e278a9c54a6fdda9d390abce4077e55b20/toolkit/components/extensions/ext-contextualIdentities.js
Attached a screenshot of the debugger
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Keywords: regression
This looks pretty bad, do you need any help replicating or anything?
Flags: needinfo?(kmaglione+bmo)
Priority: -- → P1
Whiteboard: investigating
I see some error in Firefox 55 with this extension, this may be because 55 is Bete instead Nightly for now, and privacy.userContext.enabled is disabled by default in Beta for now.


This issue may be due to the implementation of the extension. The `contextualIdentitiesEnabled` is incorrect, it may be changed  while in use, from Options or about:config with privacy.userContext.enabled. You should use `browser.contextualIdentities.query({});` to detect its status.


p.s. I have not tried to reproduce this problem.
Flags: needinfo?(mrdokenny)
Keywords: regression
Version: 55 Branch → Trunk
I detailed the issue in:

https://github.com/mrdokenny/Cookie-AutoDelete/issues/41

I did do feature detection for that API, but that's not the issue, the issue is that browser.contextualIdentities.query({}) breaks (horribly until browser restart) when you pass the results to browser.cookies.remove() using the parameter cookieStoreId.
Flags: needinfo?(mrdokenny)
Going to look into this tomorrow to test and see where we are at least.
Assignee: nobody → jkt
Hey thanks. FWIW, I can't reproduce it now in the latest Nightly 8/16 with the old 1.1.0b1, so I'm not entirely sure what happened between a couple months ago and now. I haven't tested with the other versions yet.
Also just to highlight container APIs are either enabled or not, using browser.contextualIdentities.query({}); to check if it's present will no longer work in Nightly 57.

For Nightly users by adding the permission in your manifest you will have the APIs for certain, for 55+56 checking a false response from browser.contextualIdentities.query({}); might be better yeah.
With the 2.X.X branch, I removed the cache and started directly accessing browser.contextualIdentities.query({}) again. What I noticed is in 55, there's still some problems with Containers Mode on. However, on 56+, I haven't noticed any issues.
Fresh build of C-AD 2.0.0
Attachment #8865327 - Attachment is obsolete: true
Removing assign as no longer looking at this.
Assignee: jkt → nobody
Based on comment 6 and comment 8, it seems like we should close this?
SGTM, closing also.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WORKSFORME
Product: Toolkit → WebExtensions
Flags: needinfo?(kmaglione+bmo)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: