From 7ef72ac5c4f39f7e50aaf75fbc910e601a9e2819 Mon Sep 17 00:00:00 2001 From: Infocatcher Date: Sun, 9 Apr 2017 00:12:51 +0300 Subject: [PATCH] Hack for browser.newtab.preload = true in Firefox 54+ Force override, if PrivateBrowsingUtils.isWindowPrivate() call contains our openNewPrivateTab() in stack (#252) --- bootstrap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index 78fe830..6bde05e 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -4269,9 +4269,12 @@ var privateTab = { if( ( stack.indexOf("\nprivateTab.openNewPrivateTab@") != -1 // Firefox 52 - || stack.indexOf("\nopenNewPrivateTab@") != -1 // Firefox 53 + || stack.indexOf("\nopenNewPrivateTab@") != -1 // Firefox 53+ + ) + && ( + stack.indexOf("\n_linkBrowserToTab@chrome://browser/content/tabbrowser.xml:") != -1 + || (_this.platformVersion >= 54 && prefs.getPref("browser.newtab.preload")) ) - && stack.indexOf("\n_linkBrowserToTab@chrome://browser/content/tabbrowser.xml:") != -1 ) { _log(key + "(): looks like privateTab.openNewPrivateTab() + preloaded about:newtab, override to true"); return { value: true };