open cross-origin links by background

jh-changes
Shin'ya Ueoka 7 years ago
parent 71c271cdf0
commit e2b1f0d4d5
  1. 9
      src/content/index.js

@ -27,6 +27,15 @@ const startFollows = (newTab) => {
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(); return element.click();
case 'input': case 'input':
switch (element.type) { switch (element.type) {