You can use asyncify to do synchronous fetch Вт, 7 февр. 2023 г. в 22:26, Magicalbat <magical...@comcast.net>:
> I did some looking, and it seems that you cannot interact with the dom > from a web worker. Is there a way to get around this, or is there a way to > do a synchronous fetch without a worker? > > On Monday, February 6, 2023 at 10:54:28 PM UTC-5 Magicalbat wrote: > >> Hello, >> >> I am new to emscripten and I have been trying to port some of my code to >> work with WebGL. After some difficulty, I had a file loading function >> working with a synchronous fetch that required the "--proxy-to-worker" >> compiler flag. Next, I tried to get WebGL to work, but I was not able to >> make a context. I would get this error: "Uncaught TypeError: >> Module.canvas.getContext is not a function at Worker.worker_onmessage". I >> only get this error when compiling with the proxy flag. Is there a way to >> get a WebGL context with this flag? Thanks. >> > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to emscripten-discuss+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/emscripten-discuss/bbbf53c7-51a2-4e41-904c-cd88e935a9f6n%40googlegroups.com > <https://groups.google.com/d/msgid/emscripten-discuss/bbbf53c7-51a2-4e41-904c-cd88e935a9f6n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-discuss+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/CAKOm%3DVGrWbW_YZHh-VjmpsEX-AVfc7OzLURqd01GEVsaznopAg%40mail.gmail.com.