{"record":{"id":"81b66b6f0b4c525e","repo":"microsoft/playwright","slug":"method-not-implemented","errorCode":null,"errorMessage":"Method not implemented.","messagePattern":"Method not implemented\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/playwright-core/src/server/bidi/bidiPage.ts","lineNumber":454,"sourceCode":"      delta: -1,\n    }).then(() => true).catch(() => false);\n  }\n\n  async goForward(): Promise<boolean> {\n    return await this._session.send('browsingContext.traverseHistory', {\n      context: this._session.sessionId,\n      delta: +1,\n    }).then(() => true).catch(() => false);\n  }\n\n  async requestGC(): Promise<void> {\n    const result = await this._session.send('script.evaluate', {\n      expression: 'TestUtils.gc()',\n      target: { context: this._session.sessionId },\n      awaitPromise: true,\n    });\n    if (result.type === 'exception')\n      throw new Error('Method not implemented.');\n  }\n\n  private async _onScriptMessage(event: bidi.Script.MessageParameters) {\n    if (event.channel !== kPlaywrightBindingChannel)\n      return;\n    const pageOrError = await this._page.waitForInitializedOrError();\n    if (pageOrError instanceof Error)\n      return;\n    const context = this._contextIdToContext.get(event.source.realm);\n    if (!context)\n      return;\n    if (event.data.type !== 'string')\n      return;\n    await this._page.onBindingCalled(event.data.value, context);\n  }\n\n  async addInitScript(initScript: InitScript): Promise<void> {\n    const { script } = await this._session.send('script.addPreloadScript', {","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/bidi/bidiPage.ts#L436-L472","documentation":"`requestGC` on Firefox BiDi evaluates `TestUtils.gc()` in the page; if that helper is absent (Firefox build without it, or it throws), Playwright reports the feature as not implemented. Triggering garbage collection isn't supported by this browser backend.","triggerScenarios":"Calling `page.requestGC()` (or memory/MCP tooling that invokes it) on a Firefox BiDi session where `TestUtils.gc` is unavailable, producing an exception result.","commonSituations":"Running memory-leak or GC-dependent tests against Firefox; cross-browser suites that call requestGC unconditionally; profiling/heap-snapshot tooling that forces GC.","solutions":["Gate `requestGC` by browser — only call on Chromium/WebKit","Wrap in try/catch on Firefox and ignore 'Method not implemented'","Restructure tests to not rely on forced GC in Firefox"],"exampleFix":"// before\nawait page.requestGC();\n\n// after\nconst cap = page.context().browser()?.browserType().name();\nif (cap !== 'firefox') await page.requestGC();\n// or\ntry { await page.requestGC(); } catch (e) { /* unsupported on firefox */ }","handlingStrategy":"try-catch","validationCode":"const bt = context.browser()?.browserType().name();\nif (bt && bt !== 'firefox') {\n  await page.requestGC();\n}","typeGuard":null,"tryCatchPattern":"try {\n  await page.requestGC();\n} catch (e) {\n  if (e instanceof Error && /Method not implemented/.test(e.message)) return;\n  throw e;\n}","preventionTips":["Gate requestGC by browser type","Don't make memory tests depend on forced GC under Firefox","Treat the 'Method not implemented' message as a known unsupported-feature signal"],"tags":["bidi","firefox","gc","not-supported"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}