openURL should not redirect incognito NTP to chrome URLs

This commit is contained in:
tophf 2017-06-03 16:57:52 +03:00
parent cec649e0ee
commit be9cfe072d

View File

@ -143,7 +143,8 @@ function openURL({url, currentWindow = true}) {
}
getActiveTab().then(tab => {
if (tab && tab.url == 'chrome://newtab/'
&& (!url.startsWith(URLS.ownOrigin) || !tab.incognito)) {
// prevent redirecting incognito NTP to a chrome URL as it crashes Chrome
&& (!url.startsWith('chrome') || !tab.incognito)) {
chrome.tabs.update({url}, resolve);
} else {
chrome.tabs.create(tab && !FIREFOX ? {url, openerTabId: tab.id} : {url}, resolve);