{"record":{"id":"410311cf6d3ffe54","repo":"microsoft/playwright","slug":"method-not-implemented-410311","errorCode":null,"errorMessage":"Method not implemented.","messagePattern":"Method not implemented\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/webkit/webview/wvBrowser.ts","lineNumber":368,"sourceCode":"      };\n      return cookie;\n    });\n    await page.setCookies(protocolCookies);\n  }\n\n  async doClearCookies() {\n    const page = this._cookiePage();\n    if (!page)\n      return;\n    const cookies = await page.getCookies();\n    await page.deleteCookies(cookies.map(c => ({\n      cookieName: c.name,\n      url: `${c.secure ? 'https' : 'http'}://${c.domain.replace(/^\\./, '')}${c.path}`,\n    })));\n  }\n\n  async doGrantPermissions(origin: string, permissions: string[]) {\n    throw new Error('Method not implemented.');\n  }\n\n  async doClearPermissions() {\n    throw new Error('Method not implemented.');\n  }\n\n  async setGeolocation(geolocation?: types.Geolocation): Promise<void> {\n    throw new Error('Method not implemented.');\n  }\n\n  async doUpdateExtraHTTPHeaders(): Promise<void> {\n    for (const page of this.pages())\n      await (page.delegate as WVPage).updateExtraHTTPHeaders();\n  }\n\n  async setUserAgent(userAgent: string | undefined): Promise<void> {\n    this._options.userAgent = userAgent;\n    for (const page of this.pages())","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts#L350-L386","documentation":"The iOS Safari webview backend throws 'Method not implemented.' for context capabilities the WKWebView/ios_webkit_debug_proxy surface does not expose: granting permissions (doGrantPermissions), clearing permissions, geolocation, and several other overrides. These are deliberate capability gaps, not transient failures — calling them signals the test is asking for a feature the backend cannot provide.","triggerScenarios":"Calling context.grantPermissions(...), context.clearPermissions(), context.setGeolocation(...), context.clearCookies (via doClose/cancelDownload/doSetHTTPCredentials/doUpdateOffline/clearCache) on a webkit.connectOverCDP iOS Safari context.","commonSituations":"Reusing a cross-browser test suite (built for chromium) that grants permissions or sets geolocation; testing geoflows or notification permissions against iOS Safari.","solutions":["Skip or conditionally disable permission/geolocation/offline tests when running against the webview (iOS Safari) backend.","Detect the backend (e.g. browser version/connection type) and branch to an alternative or a skip annotation.","Request the feature upstream if essential; meanwhile avoid the unsupported context methods."],"exampleFix":"// before\ntest('geoflow', async ({ context }) => {\n  await context.setGeolocation({ latitude: 0, longitude: 0 }); // Method not implemented\n});\n\n// after\ntest('geoflow', async ({ context, browserName }) => {\n  test.skip(browserName === 'webkit' && isWebView, 'geolocation not supported on iOS webview');\n  await context.setGeolocation({ latitude: 0, longitude: 0 });\n});","handlingStrategy":"validation","validationCode":"const UNSUPPORTED = ['grantPermissions','clearPermissions','setGeolocation','clearCache'];\nfunction isSupportedOnWebView(method) { return !UNSUPPORTED.includes(method); }\nif (isSupportedOnWebView('setGeolocation')) await context.setGeolocation(geo);","typeGuard":null,"tryCatchPattern":"try { await context.grantPermissions(perms); }\ncatch (e) {\n  if (/Method not implemented/i.test(String(e.message))) {\n    console.warn('permissions not supported on this backend — skipping');\n  } else throw e;\n}","preventionTips":["Skip permission/geolocation/offline tests on the iOS webview backend.","Detect backend type and branch or annotate the test as skipped.","Don't assume chromium-grade context capabilities on webview connections."],"tags":["webview","ios","capability","not-implemented","permissions","geolocation"],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}