open cross-origin links by background

This commit is contained in:
Shin'ya Ueoka 2017-09-20 20:18:05 +09:00
parent 71c271cdf0
commit e2b1f0d4d5

View file

@ -27,6 +27,15 @@ const startFollows = (newTab) => {
newTab
});
}
if (element.href.startsWith('http://') ||
element.href.startsWith('https://') ||
element.href.startsWith('ftp://')) {
return browser.runtime.sendMessage({
type: messages.OPEN_URL,
url: element.href,
newTab
});
}
return element.click();
case 'input':
switch (element.type) {