openURL fix for opera:// URLs
This commit is contained in:
parent
a2ea1bb1d9
commit
1166fd9d3b
|
@ -150,6 +150,8 @@ function openURL({url, currentWindow = true}) {
|
||||||
url = chrome.runtime.getURL(url);
|
url = chrome.runtime.getURL(url);
|
||||||
}
|
}
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
// [some] chromium forks don't handle their fake branded protocols
|
||||||
|
url = url.replace(/^(opera|vivaldi)/, 'chrome');
|
||||||
// API doesn't handle the hash-fragment part
|
// API doesn't handle the hash-fragment part
|
||||||
chrome.tabs.query({url: url.replace(/#.*/, ''), currentWindow}, tabs => {
|
chrome.tabs.query({url: url.replace(/#.*/, ''), currentWindow}, tabs => {
|
||||||
for (const tab of tabs) {
|
for (const tab of tabs) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user