diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/messages.js | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/shared/messages.js b/src/shared/messages.js deleted file mode 100644 index 517fc4c..0000000 --- a/src/shared/messages.js +++ /dev/null @@ -1,19 +0,0 @@ -const receive = (win, callback) => { - win.addEventListener('message', (e) => { - let message; - try { - message = JSON.parse(e.data); - } catch (e) { - // ignore message posted by author of web page - return; - } - - callback(message); - }) -} - -const send = (win, message) => { - win.postMessage(JSON.stringify(message), '*'); -} - -export { receive, send }; |