|
-
Feb 17th, 2007, 12:51 AM
#1
Thread Starter
Lively Member
[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
Thank you 
-
Feb 17th, 2007, 01:02 AM
#2
Re: WebBrowser issues. suggest please.
well have you tried compiling and seeing if that works?
If a post has been helpful please rate it. 
If your question has been answered, pull down the tread tools and mark it as resolved.
-
Feb 17th, 2007, 01:36 AM
#3
Re: WebBrowser issues. suggest please.
you could try using SendKeys to automatically press the "Cancel" Button
My usual boring signature: Something
-
Feb 17th, 2007, 01:47 AM
#4
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.
-
Feb 17th, 2007, 01:56 AM
#5
Thread Starter
Lively Member
Re: WebBrowser issues. suggest please.
Nice! Disabled it in "internet tools" and added the "silent" in code.
All prompting vanished! 
Thank you
Thank you 
-
Feb 17th, 2007, 02:13 AM
#6
Thread Starter
Lively Member
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
Thank you 
-
Feb 17th, 2007, 02:18 AM
#7
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.
-
Feb 17th, 2007, 02:31 AM
#8
Re: WebBrowser issues. suggest please.
 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...
My usual boring signature: Something
-
Feb 17th, 2007, 02:36 AM
#9
Re: [RESOLVED] WebBrowser issues. suggest please.
May be. I haven't checked them individually. That's what I found on IE Blog
-
Feb 17th, 2007, 03:11 AM
#10
Thread Starter
Lively Member
Re: [RESOLVED] WebBrowser issues. suggest please.
 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
Thank you 
-
Feb 17th, 2007, 03:19 AM
#11
Re: [RESOLVED] WebBrowser issues. suggest please.
My usual boring signature: Something
-
Feb 17th, 2007, 04:14 AM
#12
Re: [RESOLVED] WebBrowser issues. suggest please.
 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 

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. 
Here you'll find the registry keys.
-
Feb 17th, 2007, 04:38 AM
#13
Thread Starter
Lively Member
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
Thank you 
-
Feb 17th, 2007, 03:13 PM
#14
Thread Starter
Lively Member
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.
Thank you 
-
Jun 11th, 2007, 11:07 PM
#15
Thread Starter
Lively Member
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
Last edited by sjku; Jun 11th, 2007 at 11:10 PM.
Thank you 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|