# @todo handle multiple contexts, bind a unique id from the browser on each req?
self.context=self.playwright_browser.new_context(
accept_downloads=False,# Should never be needed
bypass_csp=True,# This is needed to enable JavaScript execution on GitHub and others
accept_downloads=False,# Should never be needed
bypass_csp=True,# This is needed to enable JavaScript execution on GitHub and others
extra_http_headers=self.headers,
ignore_https_errors=True,
proxy=proxy,
service_workers=os.getenv('PLAYWRIGHT_SERVICE_WORKERS','allow'),# Should be `allow` or `block` - sites like YouTube can transmit large amounts of data via Service Workers
# Set user agent to prevent Cloudflare from blocking the browser
# Use the default one configured in the App.py model that's passed from fetch_site_status.py
context=browser.new_context(
accept_downloads=False,# Should never be needed
accept_downloads=False,# Should never be needed
bypass_csp=True,# This is needed to enable JavaScript execution on GitHub and others
extra_http_headers=request_headers,
ignore_https_errors=True,
proxy=self.proxy,
service_workers=os.getenv('PLAYWRIGHT_SERVICE_WORKERS','allow'),# Should be `allow` or `block` - sites like YouTube can transmit large amounts of data via Service Workers