Skip to content

Simplify the mobile experience for CDP Mode #4140

@mdmintz

Description

@mdmintz

Simplify the mobile experience for CDP Mode


Currently, this makes Mobile Mode work and be stealthy in CDP Mode:

import mycdp
from seleniumbase import SB

with SB(uc=True, test=True) as sb:
    sb.activate_cdp_mode()
    tab = sb.cdp.get_active_tab()
    loop = sb.cdp.get_event_loop()
    loop.run_until_complete(
        tab.send(
            mycdp.emulation.set_device_metrics_override(
                width=412, height=732, device_scale_factor=3, mobile=True
            )
        )
    )
    sb.open(URL)

I should simplify the setup with sensible defaults using mobile=True:

from seleniumbase import SB

with SB(uc=True, test=True, mobile=True) as sb:
    sb.activate_cdp_mode(URL)

Metadata

Metadata

Assignees

Labels

UC Mode / CDP ModeUndetected Chromedriver Mode / CDP ModeenhancementMaking things better

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions