{"record":{"id":"457f0f1823063f60","repo":"microsoft/playwright","slug":"not-implemented","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/playwright-core/src/server/bidi/bidiPage.ts","lineNumber":508,"sourceCode":"  }\n\n  async closePage(runBeforeUnload: boolean): Promise<void> {\n    if (runBeforeUnload) {\n      this._session.sendMayFail('browsingContext.close', {\n        context: this._session.sessionId,\n        promptUnload: runBeforeUnload,\n      });\n    } else {\n      await this._session.send('browsingContext.close', {\n        context: this._session.sessionId,\n        promptUnload: runBeforeUnload,\n      });\n    }\n  }\n\n  async setBackgroundColor(color?: { r: number; g: number; b: number; a: number; }): Promise<void> {\n    if (color)\n      throw new Error('Not implemented');\n  }\n\n  async takeScreenshot(progress: Progress, format: string, documentRect: types.Rect | undefined, viewportRect: types.Rect | undefined, quality: number | undefined, fitsViewport: boolean, scale: 'css' | 'device'): Promise<Buffer> {\n    const rect = (documentRect || viewportRect)!;\n    const { data } = await progress.race(this._session.send('browsingContext.captureScreenshot', {\n      context: this._session.sessionId,\n      format: {\n        type: `image/${format === 'png' || format === 'webp' ? format : 'jpeg'}`,\n        quality: quality !== undefined ? quality / 100 : undefined,\n      },\n      origin: documentRect ? 'document' : 'viewport',\n      clip: {\n        type: 'box',\n        ...rect,\n      }\n    }));\n    return Buffer.from(data, 'base64');\n  }","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/bidi/bidiPage.ts#L490-L526","documentation":"`setBackgroundColor` in BiDi Firefox only accepts the default (no color) state; passing an explicit RGBA color throws 'Not implemented'. This backs the screenshot transparency / custom background feature which BiDi does not expose.","triggerScenarios":"Invoking the internal setBackgroundColor with an RGBA color, or using context/screenshot options that request a custom background color on Firefox over BiDi.","commonSituations":"Using transparent-background screenshots or a custom context background color with Firefox BiDi; porting Chromium-only screenshot setups to Firefox.","solutions":["Don't set a custom background color for Firefox BiDi sessions","Omit the color option / pass undefined","Use Chromium if this feature is required"],"exampleFix":"// before\n// options携带 backgroundColor\nawait browser.newContext({ ...opts, colorScheme: 'dark' /* + bgColor */ });\n\n// after — omit background color on firefox-bidi\nconst ctx = await browser.newContext({ /* no backgroundColor */ });","handlingStrategy":"validation","validationCode":"const isBidiFirefox = /* detect channel */ false;\nif (bgColor && !isBidiFirefox) {\n  // pass background color option\n} else {\n  // omit background color\n}","typeGuard":null,"tryCatchPattern":"try {\n  // setBackgroundcolor / context option with color\n} catch (e) {\n  if (e instanceof Error && e.message === 'Not implemented') {\n    // feature unsupported on this backend; proceed without it\n  }\n  throw e;\n}","preventionTips":["Omit background color options when targeting Firefox BiDi","Use Chromium where this feature is required","Treat 'Not implemented' as an unsupported-feature signal, not a transient error"],"tags":["bidi","firefox","screenshot","not-supported"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}