LearnNewsExamplesServices
Frontmatter
id3880
title"One thing i noticed when creating the PoC:"
stateClosed
labels
bug
assignees[]
createdAtJan 16, 2023, 9:14 PM
updatedAtJan 24, 2023, 7:22 PM
githubUrlhttps://github.com/neomjs/neo/issues/3880
authorarcman7
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 24, 2023, 7:22 PM

"One thing i noticed when creating the PoC:"

Closed v8.1.0 bug
arcman7
arcman7 commented on Jan 16, 2023, 9:14 PM

You mentioned in your medium article:

** "One thing i noticed when creating the PoC:**

worker.port.addEventListener('message', me.onMessage.bind(me), false);

does not work, while you can use addEventListener() on a non shared worker. Might be worth a ticket. This change solved it:

worker.port.onmessage = me.onWorkerMessage.bind(me);

From Mozilla:

We have to call port.start(); inside the onconnect event handler at the end if we want to use addEventListener to add a listener to the message event instead of assigning an event handler to onmessage .

arcman7 added the bug label on Jan 16, 2023, 9:14 PM
tobiu
tobiu Jan 16, 2023, 9:28 PM

Hi @arcman7!

Could you please provide more input, about what you would like to change? I am assuming you mean: https://github.com/neomjs/neo/blob/dev/src/worker/Base.mjs#L137

The current version does work in FF.

arcman7
arcman7 Jan 17, 2023, 1:06 AM

I'm not saying your code needs to be fixed since it works, but I just thought you should know that the "bug" you referenced in your medium article https://medium.com/swlh/chrome-v83-enables-js-module-support-for-sharedworkers-starting-a-new-era-for-multi-browser-dbb20366bddf

is actually a feature and working as intended. In your case all you had to do was call worker.port.start()

After you used worker.port.addEventListener('message', me.onMessage.bind(me), false);

arcman7 closed this issue on Jan 24, 2023, 7:22 PM