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 causes web fonts pending forever #6696

Closed
mstr-pezhang opened this issue Dec 25, 2020 · 6 comments
Closed

Request interception causes web fonts pending forever #6696

mstr-pezhang opened this issue Dec 25, 2020 · 6 comments

Comments

@mstr-pezhang
Copy link

mstr-pezhang commented Dec 25, 2020

Steps to reproduce

  • Puppeteer version: 5.5.0
  • Platform / OS version: Windows 10, Ubuntu 18, MacOS Big Sur
  • URLs (if applicable):
  • Node.js version: 12.19.0

What steps will reproduce the problem?

Example Script: https://github.com/mstr-pezhang/puppeteer-issue/blob/36cddcc721ec0cf228f213f72dce2addcd5e223d/test/webfont.spec.ts

  1. Create a font-face like https://github.com/mstr-pezhang/puppeteer-issue/blob/36cddcc721ec0cf228f213f72dce2addcd5e223d/static/global.css
  2. In the webpage, do not directly use the web font, but generate a DOM node to use it. https://github.com/mstr-pezhang/puppeteer-issue/blob/36cddcc721ec0cf228f213f72dce2addcd5e223d/static/add-text.js
  3. Enable request interception. For each request, simply call request.continue();.
  4. Open DevTools and go to Network tab.
  5. See that the font cannot be correctly rendered because the URL is pending forever.

What is the expected result?
The web font can be successfully loaded and rendered.

What happens instead?
The default system font is used instead, while the web font is pending forever.
https://github.com/mstr-pezhang/puppeteer-issue/actions/runs/443832997

I'm not sure if it is a Chromium issue, but there are similar issues like #4208 and #5003

@mstr-pezhang
Copy link
Author

mstr-pezhang commented Jan 12, 2021

A workaround is to enable request interception before loading the web page.
More requests will be tracked in this way, but the web font can be loaded.

@mstr-pezhang mstr-pezhang changed the title Request interception causes web fonts used in a dynamically inserted DOM node pending forever Request interception causes web fonts pending forever Jan 12, 2021
@dobesv
Copy link

dobesv commented Jul 2, 2021

In our project we are setting request interception on as right after calling newPage() and before opening any pages but we are still having this problem.

@benallfree
Copy link
Contributor

@mstr-pezhang Can you please verify that #7802 fixes this issue?

@slawiko
Copy link

slawiko commented Dec 22, 2021

@benallfree probably that could help:

I had similar issue with Font request pending for more than 30sec (I had timeout 35s). After upgrade on 13.0.0 this issue is completely gone

@mstr-pezhang
Copy link
Author

@mstr-pezhang Can you please verify that #7802 fixes this issue?

Thanks!
Tested puppeteer v12.01, v13.0.1 and v13.2.0.
Now the issue is gone.

@rudolfbyker
Copy link

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

No branches or pull requests

5 participants