From b34edaea72ef9178d2bac55b97c607fa589571df Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Sun, 24 Sep 2023 16:45:10 -0300 Subject: [PATCH] Allow parsing a file from window.postMessage() --- src/components/SideBarFileManager.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/SideBarFileManager.vue b/src/components/SideBarFileManager.vue index 8b08259f..17557c27 100644 --- a/src/components/SideBarFileManager.vue +++ b/src/components/SideBarFileManager.vue @@ -209,6 +209,15 @@ export default { } }, mounted () { + window.addEventListener('message', (event) => { + if (event.data.type === 'arrayBuffer') { + worker.postMessage({ + action: 'parse', + file: event.data.data, + isTlog: false + }) + } + }) worker.onmessage = (event) => { if (event.data.percentage) { this.state.processPercentage = event.data.percentage