{"record":{"id":"dbd9c552e803fdb3","repo":"microsoft/playwright","slug":"css-screenshots-are-not-implemented","errorCode":null,"errorMessage":"css screenshots are not implemented","messagePattern":"css screenshots are not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/webkit/webview/wvPage.ts","lineNumber":783,"sourceCode":"    throw new Error('Method not implemented');\n  }\n\n  private validateScreenshotDimension(side: number, omitDeviceScaleFactor: boolean) {\n    // Cairo based implementations (Linux and Windows) have hard limit of 32767\n    // (see https://github.com/microsoft/playwright/issues/16727).\n    if (process.platform === 'darwin')\n      return;\n    if (!omitDeviceScaleFactor && this._page.browserContext._options.deviceScaleFactor)\n      side = Math.ceil(side * this._page.browserContext._options.deviceScaleFactor);\n    if (side > 32767)\n      throw new Error('Cannot take screenshot larger than 32767 pixels on any dimension');\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 omitDeviceScaleFactor = scale === 'css';\n    if (omitDeviceScaleFactor)\n      throw new Error('css screenshots are not implemented');\n    this.validateScreenshotDimension(rect.width, omitDeviceScaleFactor);\n    this.validateScreenshotDimension(rect.height, omitDeviceScaleFactor);\n    const result = await progress.race(this._session.send('Page.snapshotRect', { ...rect, coordinateSystem: documentRect ? 'Page' : 'Viewport' }));\n    const prefix = 'data:image/png;base64,';\n    let buffer: Buffer = Buffer.from(result.dataURL.substr(prefix.length), 'base64');\n    if (format === 'jpeg') {\n      buffer = jpegjs.encode(PNG.sync.read(buffer), quality).data;\n    } else if (format === 'webp') {\n      const png = PNG.sync.read(buffer);\n      // Match the native WebKit encoder: webp quality 100 (or omitted) is lossless.\n      buffer = (quality === undefined || quality >= 100) ? encodeWebp(png, { lossless: true }) : encodeWebp(png, { quality });\n    }\n    return buffer;\n  }\n\n  async getContentFrame(handle: dom.ElementHandle): Promise<frames.Frame | null> {\n    if (!handle._objectId)\n      return null;","sourceCodeStart":765,"sourceCodeEnd":801,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/webkit/webview/wvPage.ts#L765-L801","documentation":"Error \"css screenshots are not implemented\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/server/webkit/webview/wvPage.ts:783 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}