aboutsummaryrefslogtreecommitdiff
path: root/src/content/console-frames.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2017-11-11 11:18:01 +0000
committerGitHub <noreply@github.com>2017-11-11 11:18:01 +0000
commit0630c8f56664ac48f4cf8799dc1d88a6388957a6 (patch)
treed9160c76f4c3435b0859669f1254b12eb92d183f /src/content/console-frames.js
parent86b534b1e1de03d51efb9f28cd32296d037f07fc (diff)
parentfe8a9283172e43e29480c4293c34565859c04c32 (diff)
Merge pull request #142 from ueokande/find-mode
[WIP] Find mode
Diffstat (limited to 'src/content/console-frames.js')
-rw-r--r--src/content/console-frames.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/content/console-frames.js b/src/content/console-frames.js
index 35b975f..515ae09 100644
--- a/src/content/console-frames.js
+++ b/src/content/console-frames.js
@@ -1,4 +1,5 @@
import './console-frame.scss';
+import messages from 'shared/messages';
const initialize = (doc) => {
let iframe = doc.createElement('iframe');
@@ -20,4 +21,11 @@ const postMessage = (doc, message) => {
iframe.contentWindow.postMessage(JSON.stringify(message), '*');
};
-export { initialize, blur, postMessage };
+const postError = (doc, message) => {
+ return postMessage(doc, {
+ type: messages.CONSOLE_SHOW_ERROR,
+ text: message,
+ });
+};
+
+export { initialize, blur, postMessage, postError };