prasanaworld/puppeteer-screen-recorder

prevent cors issue

Closed this issue · 4 comments

  • I'm submitting a ...

    [X] question about how to use this project

Hi, when Im using a local url ("file://C:.......") Im getting white screen due to cors problem (when trying to capture an image in the website for example). when im running a local server and then record its url everything is working perfectly. is there an option to disable cors when running?
thanks.

is there an option for passing chrome flags?

Hi @IdanRot,

I don't think the CORS issue would happen because of puppeteer-screen-recorder. Probably sometime related to a specific use-case that your trying to solve.

Could you please share a sample code so that I could try to reproduce the same behaviour ?

Hi, adding args : "--disable-web-security" in the .lunch() did the trick. thanks :)

code sample for people in the future:

  const browser = await puppeteer.launch({
	  args: [
		"--disable-web-security", // disable cors
	  ]
  });

Closing the defect, since this is out of scope for puppeteer-screen-recorder plugin