Skip to content

Unable to pass special options (like "tzone") when opening new tabs in CDP Mode #4157

@mdmintz

Description

@mdmintz

Unable to pass special options (like tzone) when opening new tabs in CDP Mode


The following examples should be possible, but currently they're not:

from seleniumbase import SB

creepjs_timezone_url = "https://abrahamjuliot.github.io/creepjs/tests/timezone.html"

with SB(uc=True, test=True) as sb:
    sb.activate_cdp_mode(creepjs_timezone_url, tzone="Asia/Kolkata")
    sb.open_new_tab(creepjs_timezone_url, tzone="Asia/Tokyo")
    sb.sleep(5)

and also:

from seleniumbase import SB

creepjs_timezone_url = "https://abrahamjuliot.github.io/creepjs/tests/timezone.html"

with SB(uc=True, test=True) as sb:
    sb.activate_cdp_mode()
    sb.open(creepjs_timezone_url, tzone="Asia/Kolkata")
    sb.open_new_tab(creepjs_timezone_url, tzone="Asia/Tokyo")
    sb.sleep(5)

and also:

from seleniumbase import SB

creepjs_timezone_url = "https://abrahamjuliot.github.io/creepjs/tests/timezone.html"

with SB(uc=True) as sb:
    sb.activate_cdp_mode(creepjs_timezone_url, tzone="Asia/Kolkata")
    sb.cdp.open_new_tab(switch_to=True, tzone="Asia/Tokyo")
    sb.cdp.open(creepjs_timezone_url)
    sb.sleep(5)

and also:

from seleniumbase import SB

creepjs_timezone_url = "https://abrahamjuliot.github.io/creepjs/tests/timezone.html"

with SB(uc=True) as sb:
    sb.activate_cdp_mode(creepjs_timezone_url, tzone="Asia/Kolkata")
    sb.cdp.open_new_tab()
    sb.cdp.open(creepjs_timezone_url, tzone="Asia/Tokyo")
    sb.sleep(5)

The relevant methods should be fixed so that the above examples work.

Metadata

Metadata

Assignees

Labels

UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModebugUh oh... Something needs to be fixed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions