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

Request Interception issue with base href #4337

Closed
ps-mariotacke opened this issue Apr 25, 2019 · 5 comments · Fixed by #4358
Closed

Request Interception issue with base href #4337

ps-mariotacke opened this issue Apr 25, 2019 · 5 comments · Fixed by #4358
Labels
bug chromium Issues with Puppeteer-Chromium upstream

Comments

@ps-mariotacke
Copy link

Request interception appears to be faulty and results in a navigation error.

Environment

  • Puppeteer version: 1.14.0-next.1556048038195, tested 10.11 until next
  • Chromium version: r641577
  • Platform / OS version: macOS 10.14.3 Mojave
  • Node.js version: 8.15.1, tested up until 10.15.3

Steps to reproduce

  1. Clone https://github.com/ps-mariotacke/puppeteer-intercept-issue a stripped down sample
  2. Run npm install
  3. Run npm start

What is the expected result?
Chromium spawns and takes a screenshot. It should have setRequestInterception enabled on the page.

What happens instead?
Chromium gets stuck and errors with a navigation error.

Additional information

  • I included a broken.html and working.html payload which can be switched in the index.js at the top. The only difference between these two payloads is that the broken payload specifies a <base href="..."> in <head>. The working payload does not include the base href and instead specifies the fully qualified url in the script tag.
  • https://github.com/ps-mariotacke/puppeteer-intercept-issue

Related to #3471

@ps-mariotacke
Copy link
Author

Still broken in 1.15.0-next.1556265138389.

@aslushnikov
Copy link
Contributor

@ps-mariotacke This is super cool, thank you for the beautiful repro! Looks like a peculiar corner case somewhere in blink.

I'll try to further reduce this to narrow the scope.

@aslushnikov aslushnikov added bug chromium Issues with Puppeteer-Chromium upstream labels Apr 26, 2019
aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Apr 26, 2019
`Network.requestWillBeSent` is not issued for the redirect inside
sync XHRs.

References puppeteer#4337.
aslushnikov added a commit that referenced this issue Apr 26, 2019
`Network.requestWillBeSent` is not issued for the redirect inside
sync XHRs.

References #4337.
@aslushnikov
Copy link
Contributor

The upstream fix is out for review: https://chromium-review.googlesource.com/c/chromium/src/+/1586346

aslushnikov added a commit to aslushnikov/puppeteer that referenced this issue Apr 28, 2019
This roll includes:
- https://crrev.com/653809 - FrameLoader: ignore failing provisional loads entirely
- https://crrev.com/654750 - DevTools: make sure Network.requestWillBeSent is emitted on time for sync xhrs

The FrameLoader patch is the reason behind the test change. It's
actually desirable to fail frame navigation if the frame detaches - and
that's consistent with Firefox.

Fixes puppeteer#4337
aslushnikov added a commit that referenced this issue Apr 29, 2019
This roll includes:
- https://crrev.com/653809 - FrameLoader: ignore failing provisional loads entirely
- https://crrev.com/654750 - DevTools: make sure Network.requestWillBeSent is emitted on time for sync xhrs

The FrameLoader patch is the reason behind the test change. It's
actually desirable to fail frame navigation if the frame detaches - and
that's consistent with Firefox.

Fixes #4337
@aslushnikov
Copy link
Contributor

@ps-mariotacke The fix is merged now. The https://github.com/ps-mariotacke/puppeteer-intercept-issue now works with puppeteer@next, specifically with puppeteer@1.15.0-next.1556508387804.

Please give it a try!

@ps-mariotacke
Copy link
Author

Confirmed working in puppeteer@1.15.0-next.1556508387804. Thank you very much for the quick turn-around @aslushnikov. 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug chromium Issues with Puppeteer-Chromium upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants