diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-08 19:08:51 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-10-08 19:58:36 +0900 |
commit | 7ac00fce6f6c431f96c531179c6af3796df7e07a (patch) | |
tree | a10db125bd25c1447bb08de2ef156c010243f019 /src/content | |
parent | b0d2b5328107a9a2018132938fb5a9efcd77fc50 (diff) |
Show info on yanked
Diffstat (limited to 'src/content')
-rw-r--r-- | src/content/actions/operation.js | 7 | ||||
-rw-r--r-- | src/content/console-frames.js | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/content/actions/operation.js b/src/content/actions/operation.js index 0c8b0ff..0d5088b 100644 --- a/src/content/actions/operation.js +++ b/src/content/actions/operation.js @@ -4,6 +4,7 @@ import * as scrolls from 'content/scrolls'; import * as navigates from 'content/navigates'; import * as urls from 'content/urls'; import * as followActions from 'content/actions/follow'; +import * as consoleFrames from 'content/console-frames'; const exec = (operation) => { switch (operation.type) { @@ -34,7 +35,11 @@ const exec = (operation) => { case operations.NAVIGATE_ROOT: return navigates.root(window); case operations.URLS_YANK: - return urls.yank(window); + urls.yank(window); + return consoleFrames.postMessage(window.document, { + type: messages.CONSOLE_SHOW_INFO, + text: 'Current url yanked', + }); default: browser.runtime.sendMessage({ type: messages.BACKGROUND_OPERATION, diff --git a/src/content/console-frames.js b/src/content/console-frames.js index 3f06466..35b975f 100644 --- a/src/content/console-frames.js +++ b/src/content/console-frames.js @@ -15,4 +15,9 @@ const blur = (doc) => { iframe.blur(); }; -export { initialize, blur }; +const postMessage = (doc, message) => { + let iframe = doc.getElementById('vimvixen-console-frame'); + iframe.contentWindow.postMessage(JSON.stringify(message), '*'); +}; + +export { initialize, blur, postMessage }; |