Closed MatzeKitt closed 11 years ago
Unfortunately seems like proposed way https://developer.mozilla.org/en-US/docs/Supporting_per-window_private_browsing#Preventing_a_private_session_from_ending is already used in nsDownloadManager.cpp: http://hg.mozilla.org/mozilla-central/file/3fb2370f4871/toolkit/components/downloads/nsDownloadManager.cpp#l2424 (and works only for private browser windows)
Oh, yes, this is just about closing windows: http://hg.mozilla.org/mozilla-central/file/3fb2370f4871/browser/base/content/browser.js#l5945 And there is no API to cancel tab closing...
What a pity...
I reported this to Firefox developers: https://bugzilla.mozilla.org/show_bug.cgi?id=867349
But seems like only extensions may be buggy with this...
I added some workarounds for this issue. I still can't prevent tab closing (and only can override gBrowser.removeTab() to do this), but seems all works fine, if I just open new private tab instead. Looks a bit strange, but better than nothing.
And still showing built-in warnings for private windows...
Test version: private_tab-0.1.3pre-fx-sm.xpi (source)
And still showing built-in warnings for private windows...
Should be better now: I created wrapper around built-in warnAboutClosingWindow()
to make all windows looks like non-private (and send "last-pb-context-exiting"
notification myself, so all warnings should work correct).
Test version: private_tab-0.1.3pre2-fx-sm.xpi (source)
Seems to be fixed now. :)
If a download is active and you want to close the last tab in private mode, the download stops without finishing. Is there any possibility to add a notification as in the original private mode?