# @todo handle multiple contexts, bind a unique id from the browser on each req?
# @todo handle multiple contexts, bind a unique id from the browser on each req?
self.context=self.playwright_browser.new_context(
self.context=self.playwright_browser.new_context(
# This is needed to enable JavaScript execution on GitHub and others
accept_downloads=False,# Should never be needed
bypass_csp=True,
bypass_csp=True,# This is needed to enable JavaScript execution on GitHub and others
# Should never be needed
proxy=proxy,
accept_downloads=False,
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
# 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
# Use the default one configured in the App.py model that's passed from fetch_site_status.py
context=browser.new_context(
context=browser.new_context(
accept_downloads=False,# Should never be needed
bypass_csp=True,# This is needed to enable JavaScript execution on GitHub and others
proxy=self.proxy,
proxy=self.proxy,
# This is needed to enable JavaScript execution on GitHub and others
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