How to use Playwright's bypassCsp option?
# crawlee-js
j
I would like to use: https://playwright.dev/docs/api/class-testoptions#test-options-bypass-csp Any idea how I can do that in crawlee?
h
message has been deleted
j
Bump.
l
Hi @Jeno You can try:
Copy code
const playwrightCrawler = new PlaywrightCrawler({
    launchContext: {
        launchOptions: { bypassCSP: true },
    },
});
j
Hi @Lukas Celnar , I get this ts error: Object literal may only specify known properties, and 'bypassCSP' does not exist in type 'LaunchOptions'. ts(2353)
l
Hi @Jeno Could you please confirm that you are using playwright with latest version of crawlee? I was able to successfully run this exact code without any error and typescript error/warning:
Copy code
const crawler = new PlaywrightCrawler({
    proxyConfiguration,
    requestHandler: router,
    headless: false,
    launchContext: {
        launchOptions: { bypassCSP: true },
    },
});
j
Indeed, I just updated Playwright version and it accepts the option. Thank you for your help!