Closed PATAPOsha closed 1 year ago
Seems like adding bypassCSP: true,
into browser.newContext()
fixesthe issue
https://playwright.dev/docs/api/class-browser#browser-new-context-option-bypass-csp
my fixed index.js:
let emulateTemplate = {
...iPhone11,
locale: "en-US",
deviceScaleFactor: Utils.getRandomInt(1, 3),
isMobile: Math.random() > 0.5,
hasTouch: Math.random() > 0.5,
userAgent: this.userAgent,
bypassCSP: true, // <-------- fix
};
emulateTemplate.viewport.width = Utils.getRandomInt(320, 1920);
emulateTemplate.viewport.height = Utils.getRandomInt(320, 1920);
this.context = await this.browser.newContext({
...emulateTemplate,
});
But I'm not sure why it happened. Maybe chrome version was updated automatically and its better to pin playwright/chrome version in the requiremnets...
I was using the same Dockerfile a week ago and everything was ok, but a couple of days ago it started to throw error at server initialization. After starting docker container, server throws this error and don't receive any requests:
If fields below will be empty then issue will be Ignored and Closed
To Reproduce Steps to reproduce the behavior: