Window.open() in run Javascript Function block opens a lot of tabs

window_open_javascript_function
When I run this block, it would open a lot of tabs. Then, the Snap editor would crash. When I open the console, I see this error: too much recursion threads.js:763:22. I use Firefox. The expected behavior is to open only one tab. Why is it not working as expected?

interesting. Looks like a Firefox issue, though, as it doesn't happen in other browsers...

It seems like Snap! is trying to catch an error, and so running the block recursively. Try disabling isCatchingErrors.

It only tries once when Firefox blocks it.

I tried running it in development mode. It still opened a lot of tabs. But this time, the console did not show any errors, and the Snap editor was not crashing.

Yep, I noticed this in Firefox, too. It actually bit me in the middle of a presentation :frowning:

It needs a return value!

Congradulations!this is the 1000th topic!!!

A return value is not needed if the function is run instead of called.

Something similar happened to me too.

I think I just solved it.

But how do I prevent call from infinitely looping?

I don't know why Firefox keeps opening tabs or how to prevent it.

No, I mean how to stop the call function after it doesn't get a return value once.

Stop sign or stop block.