I worked around this issue by using AutoIT.
First, you'll need to create the script.
closechromewarning.au3:
WinWaitActive("[CLASS:Chrome_WidgetWin_1]") Send("{ESC}")
The script needs to be compiled to a .exe
, then place the .exe
in the path so it can be run.
Function that closes the warning, using c# syntax:
public void CloseChromeDialog() { System.Threading.Thread.Sleep(5000); Process.Start(@".\closechromewarning.exe"); }
Sleep(4000)
did work, but I upped it to Sleep(5000)
just to be sure.
Calling CloseChromeDialog()
:
if(browser == chrome) //pseudo code CloseChromeDialog();