{"record":{"id":"2f311a50f2d637d5","repo":"microsoft/playwright","slug":"invalid-data-url-url-slice-0-80","errorCode":null,"errorMessage":"Invalid data URL: ${url.slice(0, 80)}","messagePattern":"Invalid data URL: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/server/webkit/webview/wvPage.ts","lineNumber":519,"sourceCode":"    const loaderIdPromise = new Promise<string>(resolve => {\n      this._pendingMainFrameLoaderResolvers.set(frame._id, resolve);\n    });\n    try {\n      this._session.sendMayFail('Runtime.evaluate', {\n        expression: `window.location.href = ${JSON.stringify(url)}`,\n        returnByValue: true,\n      } as any);\n      const loaderId = await loaderIdPromise;\n      return { newDocumentId: loaderId };\n    } finally {\n      this._pendingMainFrameLoaderResolvers.delete(frame._id);\n    }\n  }\n\n  private async _navigateToDataUrl(frame: frames.Frame, url: string): Promise<frames.GotoResult> {\n    const match = /^data:([^,]*),([\\s\\S]*)$/.exec(url);\n    if (!match)\n      throw new Error(`Invalid data URL: ${url.slice(0, 80)}`);\n    const meta = match[1];\n    const data = match[2];\n    const content = /;base64$/i.test(meta)\n      ? Buffer.from(data, 'base64').toString('utf8')\n      : decodeURIComponent(data);\n    const result = await this._navigateMainFrame(frame, 'about:blank');\n    await this._session.sendMayFail('Runtime.evaluate', {\n      expression: `(function() { document.open(); document.write(${JSON.stringify(content)}); document.close(); })()`,\n    } as any);\n    return result;\n  }\n\n  _onConsoleMessage(event: Protocol.Console.messageAddedPayload) {\n    // Note: do no introduce await in this function, otherwise we lose the ordering.\n    // For example, frame.setContent relies on this.\n    const { type, level, text, parameters, url, line: lineNumber, column: columnNumber, source } = event.message;\n\n    if (level === 'debug' && parameters && parameters.length >= 2 && parameters[0].type === 'string') {","sourceCodeStart":501,"sourceCodeEnd":537,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/server/webkit/webview/wvPage.ts#L501-L537","documentation":"Error \"Invalid data URL: ${url.slice(0, 80)}\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/server/webkit/webview/wvPage.ts:519 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"}