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

Page reload after private tab toggling #245

Open ghost opened 7 years ago

Infocatcher commented 7 years ago

See #237. Toggling private state of already opened tab isn't possible at all in Firefox 52+ (https://bugzilla.mozilla.org/show_bug.cgi?id=1318388#c28) and may cause crash in Firefox 51+, so in Firefox 51+ now used trick with tab duplication (to change private state of new duplicated tab and close initial one). So, extensions.privateTab.toggleTabPrivateAutoReload doesn't work in Firefox 51+,

ghost commented 7 years ago

I had deleted my comment because a mistake made me lose the page ...

Private Tab v.0.2.1.2 (2017-01-27) / Firefox 51.0.1 64-BIT / Win7 64-BIT

What I had in mind was this: In a previous thread here you had told me that I could use the Custom Buttons extension to make a toggle button ... #235

For Custom Buttons extension (for "code" section in the button editor): privateTab.toggleTabPrivate(gBrowser.selectedTab); Or just like checkbox in tab context menu: document.getElementById("privateTab-tabContext-toggleTabPrivate").doCommand();

If I make that button with first code PT toggles without page reload, if I use the second code, page reloads when PT toggling (same as tab menu item).

I've tried to switch extensions.privateTab.toggleTabPrivateAutoReload to false, but page always reloads.

Page reload can be bothering when a site reinitiates the query when page reloaded, i.e searX search engine. if I toggle from tab menu, or ctrl-alt+T or Custom Button with script 2 then searX sends me to the home page. If I toggle with Custom Button fit with privateTab.toggleTabPrivate(gBrowser.selectedTab); then the toggle does not reload the page ... that's all I wanted to express.

Reading your comment leads me to believe I'd better opt for code2 in the Custom Buttons extension ...

Thanks.

ghost commented 7 years ago

I forgot to mention the exact context where I manage to toggle a page without that page being reloaded:

At this time toggling Private Tab with this button works correctly without the page being reloaded.

As I understand it this scheme wouldn't be valid starting Firefox 52 ... And it's not the only headache Mozilla's big heads are spreading. 2017 bound to be then an Apocalypse Now for developers and power users.

Infocatcher commented 7 years ago

Before Private Tab 0.2.1 and Firefox 51 "Private Tab" checkbox in tab context menu have used privateTab.toggleTabPrivate() (his internal equivalent) with additional logic to reload tab after switching (better in most cases... to instantly show private state of page). And with preferences to modify behavior: extensions.privateTab.toggleTabPrivateAutoReload (reload or not), extensions.privateTab.toggleTabPrivateAutoReload.stopLoading (stop page loading before change of private state).

In Firefox 52+ to prevent possible crashes (and yes, this is strange practice) was forbidden (from Firefox side) calls like privateTab.toggleTabPrivate(gBrowser.selectedTab) for already loaded tabs. And crashes may happens in Firefox 51+, so in Private Tab 0.2.1+ used workaround to toggle private state: open new tab (duplicate) in private mode and then close initial tab. So, privateTab.toggleTabPrivate() will not work in Firefox 52+ for already loaded tabs... Will work only second code with tab duplication trick inside.

And it's not the only headache Mozilla's big heads are spreading. 2017 bound to be then an Apocalypse Now for developers and power users.

Yes. :( Everything should be rewritten from scratch. And only if will be implemented API from Firefox side.

d5xtgr commented 7 years ago

This is a privacy lapse to my mind- if I toggle privacy off, I'm expecting any pages I visit moving forward to appear in my history. But now the current page will be added to history also, which is contrary to the previous behaviour (and no warning was given about the change). So this use case is no longer possible: I want to open a link which must be clicked on a given page (referrer header is checked) but I don't want the referring page saved to history.