From cec649e0eef78350d2cfb9fe0dab753b06b0ba11 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 3 Jun 2017 16:52:58 +0300 Subject: [PATCH] openURL should not open own pages in incognito tabs We're using the default "spanning mode" which doesn't support it --- messaging.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/messaging.js b/messaging.js index c11e1f4c..5e4766c3 100644 --- a/messaging.js +++ b/messaging.js @@ -142,7 +142,8 @@ function openURL({url, currentWindow = true}) { } } getActiveTab().then(tab => { - if (tab && tab.url == 'chrome://newtab/') { + if (tab && tab.url == 'chrome://newtab/' + && (!url.startsWith(URLS.ownOrigin) || !tab.incognito)) { chrome.tabs.update({url}, resolve); } else { chrome.tabs.create(tab && !FIREFOX ? {url, openerTabId: tab.id} : {url}, resolve);