{"record":{"id":"9e996e6ec9d2e254","repo":"microsoft/playwright","slug":"webkit-on-windows-has-a-minimal-viewport-of-250x24","errorCode":null,"errorMessage":"WebKit on Windows has a minimal viewport of 250x240.","messagePattern":"WebKit on Windows has a minimal viewport of 250x240\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/webkit/wkBrowser.ts","lineNumber":387,"sourceCode":"  async doClose(reason: string | undefined): Promise<void | 'close-browser'> {\n    if (!this._browserContextId) {\n      // Closing persistent context should close the browser.\n      return 'close-browser';\n    } else {\n      await this._browser._browserSession.send('Playwright.deleteContext', { browserContextId: this._browserContextId });\n      this._browser._contexts.delete(this._browserContextId);\n    }\n  }\n\n  async cancelDownload(uuid: string) {\n    await this._browser._browserSession.send('Playwright.cancelDownload', { uuid });\n  }\n\n  _validateEmulatedViewport(viewportSize: types.Size | undefined) {\n    if (!viewportSize)\n      return;\n    if (process.platform === 'win32' && this._browser.options.headful && (viewportSize.width < 250 || viewportSize.height < 240))\n      throw new Error(`WebKit on Windows has a minimal viewport of 250x240.`);\n  }\n}\n","sourceCodeStart":369,"sourceCodeEnd":390,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/webkit/wkBrowser.ts#L369-L390","documentation":"Headful WebKit on Windows enforces a minimum emulated viewport of 250x240 pixels; below that the browser window fails to lay out correctly. _validateEmulatedViewport() throws during context creation or viewport update when width<250 or height<240 on win32+headful.","triggerScenarios":"Launching a headful WebKit context on Windows with viewport {width<250} or {height<240}, or calling context.setViewportSize/page.setViewportSize below those bounds. Triggered in _validateEmulatedViewport during context setup.","commonSituations":"Migrating a config from headless Chromium to headful WebKit on a Windows CI runner with a tiny viewport. Reusing a mobile-emulation viewport (e.g. 200x300) without raising width. Device descriptors with very narrow widths.","solutions":["Raise the viewport to at least width 250 and height 240 for headful WebKit on Windows.","Run WebKit headless on Windows if a smaller viewport is required (the check is gated on headful).","Switch the affected tests to chromium/firefox, which do not impose this floor."],"exampleFix":"// before\nconst ctx = await webkit.launchPersistentContext('', { headless: false, viewport: { width: 200, height: 200 } });\n\n// after\nconst ctx = await webkit.launchPersistentContext('', { headless: false, viewport: { width: 250, height: 240 } });","handlingStrategy":"validation","validationCode":"const MIN_WK_WIN = { w: 250, h: 240 };\nfunction validWkViewport(viewport, opts) {\n  if (process.platform !== 'win32' || !opts.headful) return true;\n  return viewport.width >= MIN_WK_WIN.w && viewport.height >= MIN_WK_WIN.h;\n}","typeGuard":"function isAcceptableWkViewport(v: {width:number;height:number}, headful:boolean): boolean {\n  if (process.platform !== 'win32' || !headful) return true;\n  return v.width >= 250 && v.height >= 240;\n}","tryCatchPattern":null,"preventionTips":["On Windows headful WebKit keep viewport >= 250x240.","Prefer headless for very small viewports on Windows."],"tags":["webkit","windows","viewport","headful","emulation"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}