question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CORS fail after setExtraHTTPHeaders

See original GitHub issue

CORS fail after setExtraHTTPHeaders if you disable OOR-CORS(out-of-blink-cors) using below code, same code works puppeteer.launch({headless:false, launch: {args:[“–flag-switches-begin”, “–disable-features=OutOfBlinkCors”, “–flag-switches-end”]}});

any ideas?

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.19.0
  • Platform / OS version: Windows 10
  • URLs (if applicable):
  • Node.js version: v12.9.1

What steps will reproduce the problem?

/* node --experimental-repl-await */
const puppeteer = require('puppeteer')
const browser = await puppeteer.launch({headless:false})
const page = await browser.newPage()
await page.setExtraHTTPHeaders({'test':'aa'})
await page.goto('https://youtube.com')
/* F12 developer mode */

What is the expected result? CORS success regardless setExtraHTTPHeaders

What happens instead? CORS fail

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:10
  • Comments:10

github_iconTop GitHub Comments

1reaction
vkytcommented, Nov 4, 2020

Ran into the issue on 5.4.1 again and the '--disable-features=OutOfBlinkCors' workaround no longer mitigates the issue.

0reactions
stale[bot]commented, Jul 23, 2022

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

CORS fail after setExtraHTTPHeaders · Issue #4889 - GitHub
CORS fail after setExtraHTTPHeaders if you disable OOR-CORS(out-of-blink-cors) using below code, same code works
Read more >
When set custom header , why the script tag request throw ...
I think you are adding the script tag programmatically somewhere you can do something like, await page.
Read more >
3 Ways to Fix the CORS Error — and How the Access-Control ...
Fix one: install the Allow-Control-Allow-Origin plugin. The quickest fix you can make is to install the moesif CORS extension .
Read more >
Network domain - Chrome DevTools Protocol - GitHub Pages
The status code of the response. This is useful in cases the request failed and no responseReceived event is triggered, which is the...
Read more >
CORS errors - HTTP - MDN Web Docs - Mozilla
If the CORS configuration isn't setup correctly, the browser console will present an error like "Cross-Origin Request Blocked: The Same Origin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found