Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Firefox DevTools does not decode Playwright's HAR response bodies of text resources #11532

Open
DetachHead opened this issue Jan 21, 2022 · 2 comments

Comments

@DetachHead
Copy link

@DetachHead DetachHead commented Jan 21, 2022

Context:

System:

  • OS: Windows 10 10.0.18363
  • Memory: 2.46 GB / 15.78 GB

Binaries:

  • Node: 16.9.1 - C:\Program Files\nodejs\node.EXE
  • npm: 7.24.1 - C:\Program Files\nodejs\npm.CMD

Languages:

  • Bash: 5.0.17 - C:\WINDOWS\system32\bash.EXE

npmPackages:

  • playwright: ^1.18.0 => 1.18.0

Code Snippet

const context = await browser.newContext({ recordHar: { path: 'asdf.har' } })
const page = await context.newPage()
await page.goto('https://google.com/')
await context.close()

Describe the bug

har file exported by playwright:
image

har file exported manually:
image

@mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Jan 21, 2022

This works when you load the HAR file into Chromium and does not work in Firefox. Seems like Firefox does not decode the text resources, even tho we say its base64. The spec does not give any advice when to use base64 and when not, so we use it all the time.

Seems like it needs to be fixed on their (Firefox DevTools) side. Some code pointers:

@mxschmitt mxschmitt changed the title [BUG] http responses in har files are base64 encoded [BUG] Firefox DevTools does not decode Playwright's HAR response bodies of text resources Jan 21, 2022
@DetachHead
Copy link
Author

@DetachHead DetachHead commented Jan 23, 2022

the reason i used firefox for those screenshots was because in chrome the base64 responses were not being displayed at all, which i assume is somehow related.

when exported from playwright:
image

when exported manually:
image

but now that i try this on the google.com example i can't seem to reproduce it, only on the application i'm testing. it only seems to happen with sap batch requests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants