diff --git a/src/runtime/app.ts b/src/runtime/app.ts index 96b5789b..53f1fa85 100644 --- a/src/runtime/app.ts +++ b/src/runtime/app.ts @@ -31,6 +31,18 @@ This is not suitable for production use. See https://github.com/odoo/owl/blob/${hash}/doc/reference/app.md#configuration for more information.`; }; +declare global { + interface Window { + __OWL_DEVTOOLS__: { + apps: Set; + }; + } +} + +window.__OWL_DEVTOOLS__ ||= { + apps: new Set(), +}; + export class App< T extends abstract new (...args: any) => any = any, P extends object = any, @@ -48,6 +60,7 @@ export class App< constructor(Root: ComponentConstructor, config: AppConfig = {}) { super(config); this.Root = Root; + window.__OWL_DEVTOOLS__.apps.add(this); if (config.test) { this.dev = true; } @@ -109,6 +122,7 @@ export class App< this.scheduler.flush(); this.root.destroy(); } + window.__OWL_DEVTOOLS__.apps.delete(this); } createComponent

(