futurecoder icon indicating copy to clipboard operation
futurecoder copied to clipboard

Synchronous code don't work in Firefox private windows

Open leovilok opened this issue 3 years ago • 2 comments

input() and time.sleep() both work in the console in Firefox, but not when it's in a private window.

input() gives this error:

RuntimeError: This browser doesn't support reading input. Try upgrading to the most recent version or switching to a different browser, e.g. Chrome or Firefox.

While time.sleep() just returns immediately without error ... but without sleeping either.

So it's probably a comsync issue?

I'm using Firefox 104.0.2 on Linux.

leovilok avatar Sep 13 '22 12:09 leovilok

Yes, service workers are disabled in Firefox for security or something. I've been aware of this problem for ages but you're the first to mention it. But I also don't want to explicitly mention this reason in the suggestions in the error message, because "sorry this doesn't work in private browsing" sounds very suspicious.

And yes, in general the implementation for time.sleep() intentionally just returns immediately instead of raising an error when there's a sync IO problem.

Not sure if I should keep this issue open because I have no plans to fix it. The only solution I see is to go back to SharedArrayBuffers for sync IO, and that comes with other problems.

alexmojaki avatar Sep 13 '22 20:09 alexmojaki

I'd say it's more of a Firefox bug then. This seems to be an issue for a lot of sites, so hopefully they will eventually fix it.

leovilok avatar Sep 13 '22 22:09 leovilok