Checklist
What happened?
For now it seems that every worker which doesn't have CORS headers properly configured, displays the following warning in the browser console:
Unable to use `window` or `document` -> https://docs.pyscript.net/latest/faq/#sharedarraybuffer
|
"Unable to use `window` or `document` in worker. " |
It's rather weird to see this warning when worker is configured with sync_main_only = true, because if someone configures a worker that way, they somewhat agree not to use window or document, and seeing this warning could make them think their configuration is incorrect, they've put sync_main_only = true in the wrong place, etc.
It seems to me, it would be nice to suppress this warning for workers configured with sync_main_only = true.
Maybe if sync_main_only = true, window and document could be set to NotSupported without even trying to initialize them via SharedArrayBuffer.
What browsers are you seeing the problem on? (if applicable)
Chrome
Console info
Additional Context
No response
Checklist
What happened?
For now it seems that every worker which doesn't have CORS headers properly configured, displays the following warning in the browser console:
pyscript/core/src/stdlib/pyscript/context.py
Line 138 in a02ff69
It's rather weird to see this warning when worker is configured with
sync_main_only = true, because if someone configures a worker that way, they somewhat agree not to usewindowordocument, and seeing this warning could make them think their configuration is incorrect, they've putsync_main_only = truein the wrong place, etc.It seems to me, it would be nice to suppress this warning for workers configured with
sync_main_only = true.Maybe if
sync_main_only = true,windowanddocumentcould be set toNotSupportedwithout even trying to initialize them viaSharedArrayBuffer.What browsers are you seeing the problem on? (if applicable)
Chrome
Console info
Additional Context
No response