Is there a way to set site permissions? #377
Replies: 4 comments 1 reply
-
@brian-kephart hey, you could try set permissions with https://chromedevtools.github.io/devtools-protocol/tot/Browser/#method-grantPermissions
If that works please leave feedback or maybe send a PR ;) |
Beta Was this translation helpful? Give feedback.
-
Thanks for the tip! I still can't change the permissions, though. Something is happening, because the commands I tried ( browser.command "Browser.grantPermissions", permissions: ["notifications"] # returns {}
browser.evaluate "Notification.permission" # still "denied" |
Beta Was this translation helpful? Give feedback.
-
looks like a Chrome issue |
Beta Was this translation helpful? Give feedback.
-
I'm attempting to do something similar, but with page.driver.browser.command('Browser.grantPermissions', origin: page.server_url, permissions: ['clipboardReadWrite']) This, however throws the following error:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for this great library!
My specific use case for altering site permissions is that I am testing a subscription workflow for push notifications, and I would like to test the user experience when the value of
Notification.permission
is"default"
,"granted"
, or"denied"
.I'm wondering if there is a way to set this value to
"granted"
, or to modify site permissions in general. I could not find anything relevant to this in the README, the code, or the command line args.Beta Was this translation helpful? Give feedback.
All reactions