aboutsummaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
Diffstat (limited to 'src/content')
-rw-r--r--src/content/index.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/content/index.js b/src/content/index.js
index 591aa98..ad3f740 100644
--- a/src/content/index.js
+++ b/src/content/index.js
@@ -1,6 +1,7 @@
import * as scrolls from './scrolls';
import * as histories from './histories';
import * as actions from '../shared/actions';
+import * as messages from '../shared/messages';
import ConsoleFrame from '../console/console-frame';
import Follow from './follow';
@@ -71,15 +72,7 @@ window.addEventListener("keypress", (e) => {
});
});
-window.addEventListener('message', (e) => {
- let message;
- try {
- message = JSON.parse(e.data);
- } catch (e) {
- // ignore message posted by author of web page
- return;
- }
-
+messages.receive(window, (message) => {
switch (message.type) {
case 'vimvixen.commandline.blur':
if (cmd) {