Results 1 to 15 of 15

Thread: [RESOLVED] WebBrowser issues. suggest please.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    Resolved [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:
    VB Code:
    1. WebBrowser.Silent= True

    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

  2. #2
    Fanatic Member Mxjerrett's Avatar
    Join Date
    Apr 2006
    Location
    Oklahoma
    Posts
    939

    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.

  3. #3
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: WebBrowser issues. suggest please.

    you could try using SendKeys to automatically press the "Cancel" Button
    My usual boring signature: Something

  4. #4
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    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.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    Re: WebBrowser issues. suggest please.

    Nice! Disabled it in "internet tools" and added the "silent" in code.
    All prompting vanished!
    Thank you
    Thank you

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    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

  7. #7
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    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.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  8. #8
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    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...
    My usual boring signature: Something

  9. #9
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: [RESOLVED] WebBrowser issues. suggest please.

    May be. I haven't checked them individually. That's what I found on IE Blog
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  10. #10

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    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
    Thank you

  11. #11
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: [RESOLVED] WebBrowser issues. suggest please.

    My usual boring signature: Something

  12. #12
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    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

    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.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  13. #13

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    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

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    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

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Jan 2007
    Posts
    75

    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
  •  



Click Here to Expand Forum to Full Width