You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggestion: Add grant_permissions() method to sb_cdp for permission handling via CDP
Hi there 👋
I'm using seleniumbase with the sb_cdp mode (via activate_cdp_mode) and would like to grant permissions (such as geolocation) via the Chrome DevTools Protocol. The Browser.grantPermissions endpoint would allow for more flexible test setups, especially for location-based features.
defgrant_permissions(self, permission_types: list[str] = ["geolocation"], origin: str=None):
"""Grant permissions to the current page."""driver=self.driverifhasattr(driver, "cdp_base"):
driver=driver.cdp_basereturnself.loop.run_until_complete(
driver.grant_permissions(permission_types, origin)
)
This would be especially useful for tests involving location access or other permission-based browser features.
I've already implemented these changes locally and they’ve been working very well in my tests so far.
Thanks for the great project 🙌
The text was updated successfully, but these errors were encountered:
montovaneli
changed the title
Suggestion: Add`grant_permissions() method to sb_cdp for permission handling via CDP
Suggestion: Add grant_permissions() method to sb_cdp for permission handling via CDP
Jun 12, 2025
Suggestion: Add
grant_permissions()
method tosb_cdp
for permission handling via CDPHi there 👋
I'm using
seleniumbase
with thesb_cdp
mode (via activate_cdp_mode) and would like to grant permissions (such as geolocation) via the Chrome DevTools Protocol. TheBrowser.grantPermissions
endpoint would allow for more flexible test setups, especially for location-based features.💡 Suggested Implementation
In
undetected -> cdp_driver -> browser
:In
core -> sb_cdp
:This would be especially useful for tests involving location access or other permission-based browser features.
I've already implemented these changes locally and they’ve been working very well in my tests so far.
Thanks for the great project 🙌
The text was updated successfully, but these errors were encountered: