openURL should not open own pages in incognito tabs

We're using the default "spanning mode" which doesn't support it
This commit is contained in:
tophf 2017-06-03 16:52:58 +03:00
parent 14e8dedded
commit cec649e0ee

View File

@ -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);