Spector.js
Spector.js copied to clipboard
Browser extension not detecting offscreen canvas passed to webworker?
The browser extension doesn't seem to be detecting my a canvas that I have passed to a webworker
const offscreen = canvas.transferControlToOffscreen();
const worker = new Worker();
worker.postMessage(
{
type: "main/canvas-init",
payload: {
canvas: offscreen,
width: window.innerWidth,
height: window.innerHeight,
player: fetchLocalStoragePlayerData(),
}
},
[offscreen]
);
Is this supported? Should I manually use the spector.js lib instead?
Yup unfortunately it is not supported and even the lib would not be working due to the way we capture texture.
As this is getting more and more common, I really need to work on it but I won t have time before a month I guess.
Thanks @sebavan Any notes on the work needed? Maybe I or other community could hack on it.
Feel free that would be perfect, I would say at first we would need to detect the offscreen and be able to record the calls to them by simply disabling the texture captures (who relies on canvas2D internally).
This would be a great start :-)
is there any progress of this ticket?
Not at the moment, would would like to give it a try ?
It has been three years and I really hope to see this feature implemented
I wish I had more time, but I will not be able to work on it unfortunately. As it is open source, do you want to give it a try ?
I wish I had more time, but I will not be able to work on it unfortunately. As it is open source, do you want to give it a try ?
This is a lot of difficulty for me, and I still need to delve deeper into the Spector source code and webgl principles
@sebavan I created a PR which might support this feature. https://github.com/BabylonJS/Spector.js/pull/298
@Jeggery Maybe you can have a try.
BTW, the extension is based on Chrome extension manifest versoin 2 which is deprecated and can't be update anymore without upgrading to version 3
Hey @junyuecao.
I wanted to test your PR, but I haven't been able to compile your fork locally.
I ran npm install and npm run build and I'm getting a lot of typescript errors.
@pmhpereira
Could you try with npm run start? It works on my Ubuntu 20.04
I completely missed all of this !!! I am so sorry @junyuecao I will have a deep look ASAP but it sounds really good !!!
@sebavan I think the problem is that Google have deprecated the Chrome extesion manifest V2 so the extension can not be updated without updating to V3. I am not that familliar with Chrome extension so I didn't migrate to V3.