Closed
Bug 849109
Opened 12 years ago
Closed 7 years ago
Gmail Watcher doesn't work in permanent private browsing mode
Categories
(Firefox :: Extension Compatibility, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: sonthakit, Unassigned)
Details
(Whiteboard: [platform-rel-Google] [platform-rel-Gmail])
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0
Build ID: 20130215130331
Steps to reproduce:
Set privacy option to "never remember history" or set the option "always use private browsing mode"
Install add-on like gmail watcher or hotmail watcher or yahoo mail watcher or yandex mail watcher.
Log in these email to get Log-in cookie.
Right click at add-on icon and select "check now"
Actual results:
Add-on show "log out" because it xmlHttpRequest do not associate with cookie.
Expected results:
Seem like FF19 don't allow add-on to use cookie when call xmlHttpRequest in module environment. if user in the mode "never remember history" or "always use private browsing mode"
It seem like per-window private browsing with secret cookie which add-on cannot access.
How add-on use these cookie with xmlHttpRequest?
It never happen before FF19. I cannot solve this problem.
Updated•12 years ago
|
Component: Untriaged → DOM: Mozilla Extensions
Product: Firefox → Core
Comment 1•12 years ago
|
||
Yes, extensions need to update their cookie-setting code to account for changes related to per-window private browsing.
Component: DOM: Mozilla Extensions → Extension Compatibility
Product: Core → Firefox
Summary: xmlHttpRequest cannot use cookie in FF19 → Gmail Watcher doesn't work in permanent private browsing mode
Thank.
How to do that?
How xmlHttpRequest use the cookie in per-window private browsing.
It seem to use cookie from non-private window every time. If user open only one window with private browsing, it still cannot use that cookie.
Any information page for this?
Comment 3•12 years ago
|
||
The situation is either that the cookie is marked private and the XHR is public, or the cookie is public and the XHR is private. How is the cookie set, and how is the XHR created?
Cookie is created by user. And user is in mode "never remember history" or "always use private browsing" So cookie is private.
But no matter what xmlHttpRequest is private or public, it cannot get cookie.
my xmlHttpRequest run in module environment.
Try 1) Associate xmlHttpRequest with hidden window
const XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1");
var req = XMLHttpRequest();
Reference
https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Using_XMLHttpRequest_from_JavaScript_modules_.2F_XPCOM_components
It cannot get cookie.
2) Associate xmlHttpRequest with random window. But I open only one window which is private. So it should associate with that private window.
req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Components.interfaces.nsIXMLHttpRequest);
It still don't work. It still cannot get cookie.
So, How to call xmlHttpRequest and use private cookie?
Comment 5•12 years ago
|
||
Ah, I understand the problem now. Your only choice at this point is to explicitly mark the XHR's channel as private after calling XMLHttpRequest.open, like so:
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
req.channel.QueryInterface(Components.interfaces.nsIPrivateBrowsingChannel).setPrivate(PrivateBrowsingUtils.permanentPrivateBrowsing);
Sorry. I'll investigate to see whether the platform can behave better in this situation.
Thank. I will try it.
Another question is, how many set of cookie can firefox have?
You can have only two (public+private).
Or you can have multiple (public + one private per one window)?
Example for firefox 20
If I open 3 windows
window1 = public
window2 = private
window3 = private
When I set cookie in window2
can I use this cookie in window3?
Comment 7•12 years ago
|
||
There are two sets of cookies for desktop Firefox.
Updated•9 years ago
|
Whiteboard: [platform-rel-Google] [platform-rel-Gmail]
Updated•9 years ago
|
platform-rel: --- → ?
Updated•8 years ago
|
platform-rel: ? → ---
Comment 8•7 years ago
|
||
With WebExtensions being the only valid way of doing extensions in Firefox 57, I don't think this bug is still relevant.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•