ChromeDevTools / devtools-protocol

Chrome DevTools Protocol
https://chromedevtools.github.io/devtools-protocol/
BSD 3-Clause "New" or "Revised" License
1.15k stars 226 forks source link

Simulating "user gestures" #225

Open dreyks opened 4 years ago

dreyks commented 4 years ago

Hello!

I've got a question that's not strictly related to CDP but maybe you've got any answers for me :)

I'm using CDP for automated testing and when I'm trying to test the window.onbeforeunload functionality I'm facing a problem that chromium blocks the popup dialog because the frame never had a user gesture

Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Do you know of any way how can I work around this? Simulate a user gesture or maybe there's any command-line arg for chrome that will turn this security feature off?