MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / init

Method init

src/devtools/DevtoolsUtils.ts:156–175  ·  view source on GitHub ↗
(pages: Page[])

Source from the content-addressed store, hash-verified

154 }
155
156 async init(pages: Page[]) {
157 try {
158 await this.#mutex.acquire();
159 const promises = [];
160 for (const page of pages) {
161 promises.push(
162 this.#createUniverseFor(page).then(targetUniverse =>
163 this.#universes.set(page, targetUniverse),
164 ),
165 );
166 }
167
168 this.#browser.on('targetcreated', this.#onTargetCreated);
169 this.#browser.on('targetdestroyed', this.#onTargetDestroyed);
170
171 await Promise.all(promises);
172 } finally {
173 this.#mutex.release();
174 }
175 }
176
177 get(page: Page): TargetUniverse | null {
178 return this.#universes.get(page) ?? null;

Callers 2

createDebugFunction · 0.45
initFunction · 0.45

Calls 3

acquireMethod · 0.45
setMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected