Skip to content

Commit

Permalink
Update syntax to match new lib version
Browse files Browse the repository at this point in the history
  • Loading branch information
ppinchuk committed Feb 6, 2025
1 parent f7a7cc6 commit 603fd5f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions elm/web/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"Upgrade-Insecure-Requests": "1",
}
"""Default HTML header template"""
_BT_RENAME = {"chromium": "chrome"}
_BT_RENAME = {"chromium": "Chrome"}
# block pages by resource type. e.g. image, stylesheet
BLOCK_RESOURCE_TYPES = [
"beacon",
Expand Down Expand Up @@ -190,10 +190,9 @@ async def pw_page(browser, intercept_routes=False, stealth_config=None):
:class:`playwright.Page`
A new page that can be used for visiting websites.
"""
browser_type = browser.browser_type.name
browser_type = _BT_RENAME.get(browser_type, browser_type)
browser_type = _BT_RENAME.get(browser.browser_type.name, "random")

logger.trace("Loading browser context for browser type %s", browser_type)
logger.trace("Loading browser context for browser type %r", browser_type)
context = await browser.new_context(
base_url="http://127.0.0.1:443",
device_scale_factor=uniform(0.8, 1.2),
Expand Down

0 comments on commit 603fd5f

Please # to comment.