Infocatcher / Private_Tab

Adds private tabs, restartless extension for Firefox (20.0+) and SeaMonkey (2.17+)
https://addons.mozilla.org/addon/private-tab/
Other
86 stars 20 forks source link

Add notification if a download is still active #53

Closed MatzeKitt closed 11 years ago

MatzeKitt commented 11 years ago

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?

Infocatcher commented 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)

Infocatcher commented 11 years ago

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...

MatzeKitt commented 11 years ago

What a pity...

Infocatcher commented 11 years ago

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...

Infocatcher commented 11 years ago

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)

Infocatcher commented 11 years ago

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)

Infocatcher commented 11 years ago

Seems to be fixed now. :)