Open Bug 1329912 Opened 9 years ago Updated 3 years ago

Wrong "last-pb-context-exited" notification in some cases (one for child process and one for global process?)

Categories

(Firefox :: Private Browsing, defect, P3)

52 Branch
defect

Tracking

()

UNCONFIRMED
Tracking Status
firefox57 --- affected
firefox58 --- affected
firefox59 --- affected

People

(Reporter: infocatcher.bugs, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; rv:50.0) Gecko/20100101 Firefox/50.0 Build ID: 20161208153507 Steps to reproduce: 1. In Scratchpad with Environment - Browser: Services.obs.addObserver(function(subject, topic, data) { Services.console.logStringMessage("[test] " + topic); }, "last-pb-context-exited", false); 2. Open private window (open some tabs… download something, etc.) 3. Open second private window and close the first one, now opened only one private window with single private tab. 4. Load anything non-remote in that single private tab (e.g. "about:") - appears WRONG "last-pb-context-exited" notification. 5. Close that last private window: appears second (and correct) "last-pb-context-exited" notification. Actual results: Will be two "last-pb-context-exited" notifications, the first one is wrong. Expected results: Should be only one "last-pb-context-exited" notification after all private things (remote and non-remote) was closed.
Has STR: --- → yes
Component: Untriaged → Private Browsing
Summary: Wrong "last-pb-context-exited" notification on some cases (one for child process and one for global process?) → Wrong "last-pb-context-exited" notification in some cases (one for child process and one for global process?)
Especially notable if used Private Tab extension: https://addons.mozilla.org/addon/private-tab/ https://github.com/Infocatcher/Private_Tab (correctly work only latest one from GitHub) 1. Open private about:newtab, open any remote tab in private tab. 2. Close remote tab ("last-pb-context-exited" notification). 3. Close about:newtab (second "last-pb-context-exited").
Is it a recent issue?
(In reply to Loic from comment #2) > Is it a recent issue? I can reproduce with Firefox 53.0a1 (2017-01-09) (32-bit) Firefox 52.0a2 (2017-01-09) (32-bit) Firefox 51.0b12 (32-bit) For beta version was used browser.tabs.remote.autostart = true browser.tabs.remote.force-enable = true to force turn-on multi-process mode.
And with older versions like 49 or 45?
(In reply to Loic from comment #4) > And with older versions like 49 or 45? Hm, in Firefox 45.0 is also buggy...
I can't reproduce this in latest 57 or 59. Can you try again? It may have been fixed now?
Flags: needinfo?(infocatcher.bugs)
Closing RESOLVED:WORKSFORME now in FF 57.0.1. Please reopen if you are able to reliably reproduce the steps in FF 57.0.1.
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Flags: needinfo?(infocatcher.bugs)
Resolution: --- → WORKSFORME
You probably should test more carefully. Even Nightly 59.0a1 (2017-12-21) is still affected (with about:config URL as something non-remote).
Simplified STR: 1. In Scratchpad with Environment - Browser: Services.obs.addObserver(function(subject, topic, data) { Services.console.logStringMessage("[test] " + topic); }, "last-pb-context-exited", false); 2. Open private window and load any remote URL, e.g. https://www.google.com/ (in already created tab, will be private window with one tab). 3. Load in the same tab any non-remote URL, e.g. about:config: appears wrong "last-pb-context-exited" notification. 4. Close private window: appears second (and correct) "last-pb-context-exited" notification.
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
I managed to successfully reproduce the bug with the simplified STR from comment 9 on a freshly created profile (with about:support reporting "Multiprocess Windows 1/1 (Enabled by default)"). After I load google and then about:config in the same tab of a private window - I get the 'last-pb-context-exited' notification, as mentioned in step 3 - this means the bug is not fixed.
Pseudo-automated STR, in Scratchpad with Environment - Browser (devtools.chrome.enabled = true), will be 2 "last-pb-context-exited" messages in console: Services.obs.addObserver(function(subject, topic, data) { Services.console.logStringMessage("[test] " + topic + " " + new Date()); }, "last-pb-context-exited", false); var win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no,private,remote", "https://www.google.com/"); win.addEventListener("load", function() { setTimeout(function() { // Wait for tab loading win.loadURI("about:config"); // Wrong "last-pb-context-exited" setTimeout(function() { // Wait for tab loading win.close(); // Really exit from private browsing, correct "last-pb-context-exited" }, 2e3); }, 6e3); }, { once: true });
A bit corrected code from comment #11 (with observer's cleanup): var obs; Services.obs.addObserver(obs = function(subject, topic, data) { Services.console.logStringMessage("[test] " + topic + " " + new Date()); }, "last-pb-context-exited", false); var win = window.openDialog("chrome://browser/content/", "_blank", "chrome,all,dialog=no,private,remote", "https://www.google.com/"); win.addEventListener("load", function() { setTimeout(function() { // Wait for tab loading win.loadURI("about:config"); // Wrong "last-pb-context-exited" setTimeout(function() { // Wait for tab loading win.close(); // Really exit from private browsing, correct "last-pb-context-exited" setTimeout(function() { Services.obs.removeObserver(obs, "last-pb-context-exited"); }, 1e3); }, 2e3); }, 6e3); }, { once: true });
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0 I had tested this issue on Windows 10 x64, Ubuntu 14.04 x64 and Mac OS X 10.12 with latest Firefox Release(57.0.4) and the latest Nightly (59.0a1-20180107220443) and manage to reproduce the issue. When following the STR described in comment 9, "[test] last-pb-context-exited" notification is displayed in the Browser Console, first when loading the "non-remote URL"(about:config) and second time when closing the private window. Notes: Attached a screen recording of the issue: https://goo.gl/tWpf7J
Aha, confirmed. (I used the wrong "Environment" menu in my Scratchpad.) Marking as P3 for general backlog, because the effect of the bug lands on the side of "too much" private browsing. I.e., navigating to about:* pages triggers the private browsing cleanup observers. Infocatcher - is this bug adversely affecting your add-on(s)? Do you have an issue or a bug we can link from here so we can see the effect of this bug on "downstream" code?
Flags: needinfo?(infocatcher.bugs)
Priority: -- → P3
(In reply to Luke Crouch [:groovecoder] from comment #14) > Infocatcher - is this bug adversely affecting your add-on(s)? Do you have an > issue or a bug we can link from here so we can see the effect of this bug on > "downstream" code? I was noticed this issue with https://addons.mozilla.org/addon/private-tab/ But now I have workaround: https://github.com/Infocatcher/Private_Tab/blob/0.2.2/bootstrap.js#L131-L146 (And still don't have APIs for Firefox 57+: https://github.com/Infocatcher/Private_Tab_WE#issues)
Flags: needinfo?(infocatcher.bugs)
See Also: → 1701303
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.