diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-17 15:45:59 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-17 15:45:59 +0900 |
commit | 655ac16f3835ea34d87d952817053ec0d8ee797f (patch) | |
tree | cefe12bb218861fc375e21690d78115832110dcf /src/content/index.js | |
parent | 59a28d0b44bf5de9df4ed61c002c0a280ad28644 (diff) |
open link on content index
Diffstat (limited to 'src/content/index.js')
-rw-r--r-- | src/content/index.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/content/index.js b/src/content/index.js index a9ccd63..fc79f6c 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -8,6 +8,13 @@ import messages from '../messages'; consoleFrames.initialize(window.document); +const startFollows = (newTab) => { + let follow = new Follow(window.document, newTab); + follow.onActivated((element) => { + element.click(); + }); +}; + window.addEventListener('keypress', (e) => { if (e.target instanceof HTMLInputElement) { return; @@ -34,7 +41,7 @@ const execOperation = (operation) => { case operations.SCROLL_RIGHT: return scrolls.scrollRight(window); case operations.FOLLOW_START: - return new Follow(window.document, operation.newTab); + return startFollows(operation.newTab); case operations.NAVIGATE_HISTORY_PREV: return navigates.historyPrev(window); case operations.NAVIGATE_HISTORY_NEXT: |