mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 22:10:34 +00:00
✨ Expose the playground adapter for console access
mountScenario now assigns the mounted renderer to globalThis.playgroundAdapter and removes it on dispose, so the wasm module is reachable from the browser console on every playground page (for example playgroundAdapter.module._render_stats()). The benchmark verify-pages diagnostic already used this name by patching the served lib.js. The source is now the canonical writer, so the wrapper's assignment is redundant. AI-assisted-by: deepseek-flash
This commit is contained in:
parent
23109b71fe
commit
3b35187676
@ -243,9 +243,14 @@ export async function mountScenario(
|
||||
const dispose = () => {
|
||||
globalThis.removeEventListener("pagehide", dispose);
|
||||
adapter.dispose();
|
||||
if (globalThis.playgroundAdapter === renderer) {
|
||||
delete globalThis.playgroundAdapter;
|
||||
}
|
||||
};
|
||||
globalThis.addEventListener("pagehide", dispose, { once: true });
|
||||
return { ...adapter, dispose };
|
||||
const renderer = { ...adapter, dispose };
|
||||
globalThis.playgroundAdapter = renderer;
|
||||
return renderer;
|
||||
}
|
||||
|
||||
// Compatibility for the older, explicitly noncanonical comparison.html page.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user