You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Request interception causes blob URL cannot be loaded as a WebWorker script #6698
importpuppeteerfrom'puppeteer';importcomparefrom'../util/compareImage';constexampleUrl='https://docs.mapbox.com/mapbox-gl-js/api/';constbaselinePath='output/mapbox-worker-normal.png';consttargetPath='output/mapbox-worker-request-interception.png';constdiffPath='output/mapbox-worker-diff.png';letbrowser: puppeteer.Browser;letpage: puppeteer.Page;test('Launch Chrome',async()=>{browser=awaitpuppeteer.launch();});test('Enable request interception',async()=>{page=awaitbrowser.newPage();awaitpage.setRequestInterception(true);page.on('request',(req)=>{req.continue();});});test('Open example page',async()=>{awaitpage.goto(exampleUrl,{waitUntil: 'networkidle0'});},30*1000);test('Wait for 10s',(done)=>{setTimeout(done,10*1000);},15*1000);test('Take a screenshot',async()=>{constmap=awaitpage.$('#demo');awaitmap.screenshot({path: targetPath,});awaitpage.close();});test('Open example page',async()=>{page=awaitbrowser.newPage();awaitpage.goto(exampleUrl,{waitUntil: 'networkidle0'});},30*1000);test('Wait for 10s',(done)=>{setTimeout(done,10*1000);},15*1000);test('Take a screenshot',async()=>{constmap=awaitpage.$('#demo');awaitmap.screenshot({path: baselinePath,});awaitpage.close();});test('Compare 2 images',async()=>{constdiff=awaitcompare(baselinePath,targetPath,diffPath);expect(diff.differences).toBe(0);expect(diff.dimension).toBeGreaterThan(0);});test('Close',async()=>{awaitbrowser.close();});
Enable request interception and call request.continue() for each request.
Open a new page to load Mapbox example page https://docs.mapbox.com/mapbox-gl-js/api/
Wait for a while and see that all WebWorkers are not running because they are created with blob URLs.
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days.
We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!
Steps to reproduce
Tell us about your environment:
What steps will reproduce the problem?
It was not reproduced on Ubuntu or MacOS. (See the execution results in GitHub Actions https://github.com/mstr-pezhang/puppeteer-issue/actions/runs/443886088).
request.continue()for each request.https://docs.mapbox.com/mapbox-gl-js/api/mapboxgl.workerUrlinstead. Although this is a workaround forcontent security policy (Start web worker from static URL on startup mapbox/mapbox-gl-js#6058).Here's the demo project https://github.com/mstr-pezhang/chromium-issue
mapbox-worker.spec.tson a Windows machine.mapbox-worker-normal.pngandmapbox-worker-request-interception.png.What is the expected result?
WebWorkers can be loaded via blob URLs.
What happens instead?
WebWorkers created with Blob URLs are not running and Mapbox cannot be rendered.