openerTabId added in FF57: https://bugzil.la/1238314

This commit is contained in:
tophf 2017-09-30 02:40:01 +03:00
parent 9585aea08d
commit 0978308325

View File

@ -192,8 +192,10 @@ function openURL({url, currentWindow = true}) {
chrome.tabs.update({url}, resolve); chrome.tabs.update({url}, resolve);
} else { } else {
// create a new tab // create a new tab
const openerSupported = !FIREFOX && tab && !chromeInIncognito; const options = {url};
const options = openerSupported ? {url, openerTabId: tab.id} : {url}; if (tab && (!FIREFOX || FIREFOX >= 57) && !chromeInIncognito) {
options.openerTabId = tab.id;
}
chrome.tabs.create(options, resolve); chrome.tabs.create(options, resolve);
} }
}); });