What pop-up message do you want to disable? If this is a warning message, try this by explicitly resolving the window or frame object to your specific needs, Ive just accepted the top-level document, but if you need an iframe, you can access it using window.frames (0). for the first frame, etc ... (again part of JavaScript) ... here is some code suggesting that WB is your web browser ...
WB.Document.parentWindow.execScript "window.alert = function () {};", "JScript"
You should run the above code only after the whole page is loaded, I understand that it is very difficult to do (and the full-featured version has not been published yet), however I have been doing this (full proof) for some time, and you can get hints on how to do this if you read some of my previous answers labeled "webbrowser" and "webbrowser-control", but returning to the question, if you want to cancel the .confirm JavaScript message, just replace window.alert with window.confirm (of course, draw your window object with the correct object to reach the document hierarchy you are working with). You can also disable the .print method using the above method and the new IE9.prompt method.
If you want to completely disable JavaScript, you can use the registry to do this, and you must make changes to the registry before the webbrowser control loads into memory, and every time you change it (on and off), you should reload the web browser control and into memory (or just restart the application).
The registry key \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\ is the name of the key 1400 , and the value to disable it is 3, and to enable it is 0.
Of course, since there are 5 zones under the Zones key, you need to either change it for the active zone, or for all zones. However, you really do not need to do this if you want to make si supress js dialog pop-up messages.
Let me know how you go, and if I can help further.
Erx_VB.NExT.Coder
source share