New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 872156 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Sep 25
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug-Regression



Sign in to add a comment

chrome.cookies.getAll in incognito window returning all cookies (including non-icongnito windows)

Reported by opma...@gmail.com, Aug 8

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36

Steps to reproduce the problem:
1. Install chrome extension - https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg?hl=en
2. Go to www.google.com and in console add a new cookie by doing document.cookie="testcookie=abcd"

3. Using the extension, you can see this cookie in the list (google_chrome_1.JPG)

4. Now open an incognito window and open the extension.

5. You can see the cookie which was set in non incognito window in the incognito window also (google_chrome_2.JPG).

What is the expected behavior?

What went wrong?
chrome.cookie.getAll shouldn't show the cookies from main window in incognito window as the cookie store would be different. I think this is change in behavior in chrome 68.

Did this work before? Yes 66

Does this work in other browsers? Yes

Chrome version: 68.0.3440.84  Channel: stable
OS Version: 10.0
Flash Version:
 
google_chrome_2.JPG
157 KB View Download
google_chrome_1.JPG
140 KB View Download
Labels: Needs-Triage-M68 Needs-Bisect
Cc: swarnasree.mukkala@chromium.org
Labels: -Needs-Bisect M-68 M-69 Target-69 Target-68 FoundIn-68 FoundIn-69 OS-Linux OS-Mac
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue on reported chrome version #68.0.3440.84 and latest chrome version # 70.0.3515.0 by using Windows 10, Mac OS 10.12.6 and Ubuntu 17.10.

The issue sems to have inconsistent behaviour, so could not provide bisect information.Observed good(68.0.3404.0) and bad(68.0.3405.0) behaviour in M-68. Hence marking it as untraiged and requesting the dev team to look into the issue.

Thanks.!
The STR is missing step 1b - right-click the extension icon, click "manage extensions", enable "allow in incognito"

Bisected to eb0fa56ceccbc4d9b483d4d9045ae8c619a62d49
"[Extensions] Remove GetCurrentBrowser() usage from cookies API"
Landed in 68.0.3425.0
Components: -Blink>JavaScript Privacy>Incognito
Cc: mkwst@chromium.org
Owner: rdevlin....@chromium.org
Status: Assigned (was: Untriaged)
Thanks for the report!

This is interesting.  I'd bet that woxxom@ is correct that this was caused by revision eb0fa56ceccbc4d9b483d4d9045ae8c619a62d49.

However, it's not clear whether the old behavior was correct.  cookies.getAll() allows the extension to specify a store ID, and, if omitted, it will use the store of the current execution context.  My understanding is that the EditThisCookie extension is calling this method from the browser action popup.

Since the EditThisCookie extension uses the default ("spanning") incognito mode, it means that all the pages run in the same process, in the "on the record" profile. [1] This includes the browser action popup, even when the popup is shown for an incognito window.  Thus, the execution context of the call is determined to be the on-the-record profile, even though the action was clicked in an incognito window.  This worked differently before, because we were basing the context on browser (which was generally the wrong thing to do).

I could see either of these behaviors as being seen as "correct".  I'm inclined to keep the current behavior, since it is actually more in-line with the rest of our APIs (for instance, chrome.extension.inIncognitoContext will return "false" from a browser action popup from an incognito window, since the popup itself is for the on-the-record profile).

As a workaround, could the extension use the storeId parameter in cookies.getAll to specify the appropriate cookie store?

+mkwst as owner of the cookies API FYI, in case he has thoughts.  I'll own this for now, though at the moment I'm leaning towards closing this one out (but I'd like to hear any more thoughts before doing so!).

[1] https://developer.chrome.com/extensions/manifest/incognito
Cc: rhalavati@chromium.org
I think I agree with your analysis, Devlin. If the extension is running in spanning mode, it's reasonable to assume that its popup page would have the same behavior regardless of the window upon which it's acting.

That said, I can also imagine existing use cases that rely on the old behavior. Do y'all have any usage metrics for these APIs in general? And/or spanning mode choices?
We have some metrics for how often functions are called, but not with which arguments or from which contexts.  I don't think we have metrics for split vs spanning mode (though it would be interesting to).
Status: WontFix (was: Assigned)
Closing this out per #5, #7.

Sign in to add a comment