You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm attempting to debug an issue I have on an iPad regarding OPFS Web Workers, but I'm noticing that the Inline Console isn't getting any of the console.log() messages that I'm sending within my Web Worker. I've verified that I am sending and receiving messages to and from the Web Worker via other console.log() messages, and tested with having the first line of the onmessage within my worker be a console.log() as well.
Is there something I can do to enable logging from Web Workers or does this not have that kind of capability yet?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
I've never tested this within a web worker. I'm not terribly familiar with web workers, but my suspicion is the modifications we make to the things like window.onerror and window.onmessage in the main browser thread don't get carried over to the web worker threads?
I think you would have to import the script with self.importScripts("inline-console.min.js").
Changes to the window global scope don’t affect worker scopes.
Additionally, and more importantly, you can’t update the DOM from a worker, so the script would have to use ‘postMessage’ to communicate with the main thread and update the visual console.
Having investigated this, I don’t believe there’s any way to modify the global scope of a Worker thread, so in its current implementation, it’s not possible to implement this. Perhaps if the inline-console script exported a function to setup (would global trap the defining scope?, is there anyway to do this without eval?), but not right now.
I'm attempting to debug an issue I have on an iPad regarding OPFS Web Workers, but I'm noticing that the Inline Console isn't getting any of the
console.log()
messages that I'm sending within my Web Worker. I've verified that I am sending and receiving messages to and from the Web Worker via otherconsole.log()
messages, and tested with having the first line of theonmessage
within my worker be aconsole.log()
as well.Is there something I can do to enable logging from Web Workers or does this not have that kind of capability yet?
Thanks in advance!
The text was updated successfully, but these errors were encountered: