Skip to content

Comments

fix: Safer check before calling start()#656

Open
tmcw wants to merge 1 commit intoGoogleChromeLabs:mainfrom
tmcw:safe-start
Open

fix: Safer check before calling start()#656
tmcw wants to merge 1 commit intoGoogleChromeLabs:mainfrom
tmcw:safe-start

Conversation

@tmcw
Copy link

@tmcw tmcw commented Feb 13, 2024

In both of these cases, the ep variable is the scope, and in some cases there'll be a start() method available, and we want to call it. I'm not sure exactly why - such a method doesn't show up in GlobalWorkerScope but maybe it's somewhere else.

However, there might also just be a variable called start in your global scope, and it isn't a function, and Comlink will expect it to be callable. This PR compensates for that case by making sure that the value is a function before calling it.

@tmcw
Copy link
Author

tmcw commented Oct 11, 2024

Checking in - is this module still maintained, any chance to check out this issue?

@ivancuric
Copy link

ivancuric commented Oct 11, 2024 via email

@ShayMalchi
Copy link

ShayMalchi commented Jan 20, 2025

This fix is legit, and just in order to get it we are considering to fork. @benjamind @surma any chance to get this in a patch version soon?

If the DOM contains an element with id "start" it will break comlink because of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants