From 63b93ce1ca16e93563453e5caba451886fa3c01d Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 18 Nov 2018 18:47:35 +0900 Subject: Use webextension message to console --- src/console/index.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/console') diff --git a/src/console/index.jsx b/src/console/index.jsx index c0d1807..dfd323e 100644 --- a/src/console/index.jsx +++ b/src/console/index.jsx @@ -38,6 +38,5 @@ const onMessage = (message) => { }; browser.runtime.onMessage.addListener(onMessage); -window.addEventListener('message', (event) => { - onMessage(JSON.parse(event.data)); -}, false); +let port = browser.runtime.connect({ name: 'vimvixen-console' }); +port.onMessage.addListener(onMessage); -- cgit v1.2.3