[RESOLVED] WebBrowser issues. suggest please.
Hi,
I added a a web browser control. Now when I open a site, it has "javascript" errors on it. So the WebBrowser keeps prompting. To stop the prompting I added:
Now it doesn't prompt, instead it automatically opens the debugger. When I close the debugger, the program crashes.
Is there a way to trap the javascript errors on the loading page and silently append them to a text file, instead of opening the debugger or prompting? And then continue with the loading of the rest of the page.
I can write the code to append to text file, but how to trap the error and store in a variable?
Thanks :)
Re: WebBrowser issues. suggest please.
well have you tried compiling and seeing if that works?
Re: WebBrowser issues. suggest please.
you could try using SendKeys to automatically press the "Cancel" Button
Re: WebBrowser issues. suggest please.
You shouldn't worry about the debugger. Script debugging is turned off by default. So, if it is turned on, that means your user WANTS to see the debugger. Respect his/her choice. :)
For normal users, set Silent=True. That will stop the popup. But for advanced user, let them open the debugger.
You can set these options form IE.
On pre-XPSP2:
Tools->Internet Options…->Advanced->Disable Script Debugging
(Applies to both IE and Webbrowser control)
On XPSP2:
Tools->Internet Options…->Advanced->Disable Script Debugging (Internet Explorer)
Tools->Internet Options…->Advanced->Disable Script Debugging (Other)
The "Other" setting applies to WebBrowser control.
Re: WebBrowser issues. suggest please.
Nice! Disabled it in "internet tools" and added the "silent" in code.
All prompting vanished! :)
Thank you :)
Re: [RESOLVED] WebBrowser issues. suggest please.
Hi,
Is it possible to make this setting at the "form_load()" and then reverse it back to whatever the user had when form unloads?
Thanks :)
Re: [RESOLVED] WebBrowser issues. suggest please.
Yes. It is possible by modifying a value in registry.
But that will not solve the problem. Because when your program is running, all other application that uses Webbrowser control will be affected.
And if your program crashes, it will not be able to reset the value.
Re: WebBrowser issues. suggest please.
Quote:
Originally Posted by iPrank
You shouldn't worry about the debugger. Script debugging is turned off by default. So, if it is turned on, that means your user WANTS to see the debugger. Respect his/her choice. :)
For normal users, set Silent=True. That will stop the popup. But for advanced user, let them open the debugger.
You can set these options form IE.
On pre-XPSP2:
Tools->Internet Options…->Advanced->Disable Script Debugging
(Applies to both IE and Webbrowser control)
On XPSP2:
Tools->Internet Options…->Advanced->Disable Script Debugging (Internet Explorer)
Tools->Internet Options…->Advanced->Disable Script Debugging (Other)
The "Other" setting applies to WebBrowser control.
those are all exactly the same...
Re: [RESOLVED] WebBrowser issues. suggest please.
May be. I haven't checked them individually. That's what I found on IE Blog :)
Re: [RESOLVED] WebBrowser issues. suggest please.
Quote:
Originally Posted by iPrank
Yes. It is possible by modifying a value in registry.
But that will not solve the problem. Because when your program is running, all other application that uses Webbrowser control will be affected.
And if your program crashes, it will not be able to reset the value.
Oh, ok. Crashing would be a problem.
Still for knowledge purpose, can you please give me a code to modify the registry. God promise I won't use it in the distributable exe.
Might help in making installers etc...
Thanks :)
Re: [RESOLVED] WebBrowser issues. suggest please.
Re: [RESOLVED] WebBrowser issues. suggest please.
Quote:
Originally Posted by sjku
Oh, ok. Crashing would be a problem.
Still for knowledge purpose, can you please give me a code to modify the registry. God promise I won't use it in the distributable exe.
Might help in making installers etc...
Thanks :)
:lol:
Well..it is not malicious code or something. Even if your app crashes, the user can change it back from IE. We can assume s/he is a 'power user' as s/he already know how to change the default value. :D
Here you'll find the registry keys.
Re: [RESOLVED] WebBrowser issues. suggest please.
Very nice! :)
I'll post the registry code here in a new thread may be before testing it so you can tell me if there's something wrong.
I will try the registry/installer code for this thread:
http://www.vbforums.com/showthread.p...35#post2783235
Once again, so many thanks for this! :)
regards
Re: [RESOLVED] WebBrowser issues. suggest please.
Oh, I figured it all out. :)
I will have to reinstall windows 119 times before I will get it right, or before giving up...
Every time I try to test it, I get an error in my registeries...
The code at http://vbforums.com/showthread.php?t...light=registry works fine when I run it as is, but when I modify it to install an additional explorer bar like mentioned on this msdn page everything messes up.
Re: [RESOLVED] WebBrowser issues. suggest please.
Firsst of all, sorry for bumping this old thread of mine marked resolved.
Here's the problem.
I made a navigator in an app of mine. Most users of this app are people learning javascriptting, or html. Whenever they run a javascript which has errors, the entire program crashes, and all data lost. Program crashes because most of them also don't know what to do with the debugger window.
In a situation like this I cannot even make the above mentioned registry settings, because if the program crashes then this setting cannot be set back.
I was really hoping if there's a way to "trap" the javascript error, and instead of program automatically opening the debugger, "I" log the error in a file, and then make a report.
Any ideas on this, any suggestions on this are greatly appriciated. :)
I also asked the users to set the "prompting in other" (as mentioned above) to no, but in that case the debugger is launched without any prompt. I need to turn off the debugger.
Please tell me which "property" I can use, or any code you can help with. :)
In regular internet explorer if you come across a page with errors, a yellow icom is displayed in status bar. I want something similar...
Thank you :)