diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-25 12:16:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-25 12:16:31 +0000 |
commit | 40a33adf52e0767cc6ecba350112c3ded53e9355 (patch) | |
tree | 281e673e1ec8b7a3dcacabb90921feb98ac0d202 /src/content/components/common | |
parent | c6f380135d93ffecb192d30d7323888eb3d051f3 (diff) | |
parent | fda4c95b8964f9d83bd810790cec3c3cd3790e92 (diff) |
Merge pull request #94 from ueokande/target-blank
target='_blank' link
Diffstat (limited to 'src/content/components/common')
-rw-r--r-- | src/content/components/common/follow.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/content/components/common/follow.js b/src/content/components/common/follow.js index 65e0af9..4eeaaa2 100644 --- a/src/content/components/common/follow.js +++ b/src/content/components/common/follow.js @@ -54,7 +54,8 @@ export default class Follow { } openLink(element) { - if (!this.newTab) { + // Browser prevent new tab by link with target='_blank' + if (!this.newTab && element.getAttribute('target') !== '_blank') { element.click(); return; } @@ -68,7 +69,7 @@ export default class Follow { return browser.runtime.sendMessage({ type: messages.OPEN_URL, url: element.href, - newTab: this.newTab, + newTab: true, }); } @@ -117,7 +118,7 @@ export default class Follow { let element = hint.target; switch (element.tagName.toLowerCase()) { case 'a': - return this.openLink(element, this.newTab); + return this.openLink(element); case 'input': switch (element.type) { case 'file': |