diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-20 20:18:05 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-20 20:18:05 +0900 |
commit | e2b1f0d4d5b5526e61184e2c24186d422b6f8843 (patch) | |
tree | ba1e74ad3aa638f9911d5abc6d97b95bee152808 /src/content | |
parent | 71c271cdf02beca8c706a4e18832c119efa0eeea (diff) |
open cross-origin links by background
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/index.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/content/index.js b/src/content/index.js index 571a927..5f50a72 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -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) { |