1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Webbrowser control "Stop running this script"

Discussion in 'Visual Basic .NET' started by christoss1959, May 15, 2012.

  1. christoss1959

    christoss1959 Senior Member

    Joined:
    Nov 25, 2010
    Messages:
    894
    Likes Received:
    1,150
    Home Page:
    Is there a way to stop the following the "Stop running this script" message from comming up?
    I've tried setting ScriptErrorsSuppressed to True but that does not work!
    I can't use the Httpwebrequest to make the bot I need to do

    Christos
     
    • Thanks Thanks x 1
  2. Chris22

    Chris22 Regular Member

    Joined:
    Sep 29, 2010
    Messages:
    400
    Likes Received:
    1,059
    Everything web browser can do, HttpWebRequest can do.

    What are you trying to do?
     
  3. christoss1959

    christoss1959 Senior Member

    Joined:
    Nov 25, 2010
    Messages:
    894
    Likes Received:
    1,150
    Home Page:
    To my knowledge it can run scripts can it? I need the website scripts to run so that I can get my results..
     
  4. Chris22

    Chris22 Regular Member

    Joined:
    Sep 29, 2010
    Messages:
    400
    Likes Received:
    1,059
    It can't run scripts.

    If the script is getting or posting a value via ajax in order for it to work then just emulate those requests too.

    PM me the link if you want and I'll have a look for you.
     
  5. Dally

    Dally Junior Member

    Joined:
    Dec 9, 2010
    Messages:
    151
    Likes Received:
    64
    Location:
    UK
    Where are you placing this:
    Code:
    webbrowser1.scriptssuppressed = true
    Try placing it in the form1.load and in the webbrowser1.document.completed
     
  6. christoss1959

    christoss1959 Senior Member

    Joined:
    Nov 25, 2010
    Messages:
    894
    Likes Received:
    1,150
    Home Page:
    I've tried it now and it doesn't work..
    I am actually defining the web control manually so it should be showing anything but it still pops up!
     
  7. christoss1959

    christoss1959 Senior Member

    Joined:
    Nov 25, 2010
    Messages:
    894
    Likes Received:
    1,150
    Home Page:
    In case anyone is interested this seems to do the trick just add it before you start using the webbrowser (it basically goes to the registry and asks to increase the delay before the error message pops up):
    Code:
    
    Dim RegKeyWrite As RegistryKey = Registry.CurrentUser 
    RegKeyWrite = RegKeyWrite.CreateSubKey("Software\Microsoft\Internet Explorer\Styles") 
    RegKeyWrite.SetValue("MaxScriptStatements", 1000000000) 
    RegKeyWrite.Close()  
    Dim RegKeyRead As RegistryKey = Registry.CurrentUser 
    RegKeyRead = RegKeyRead.OpenSubKey("Software\Microsoft\Internet Explorer\Styles")
     Dim regSuccessful As [Object] = RegKeyRead.GetValue("MaxScriptStatements") RegKeyRead.Close() 
    
     
  8. MrErwan

    MrErwan Newbie

    Joined:
    Apr 19, 2012
    Messages:
    1
    Likes Received:
    1
    Add this either right after you declare your web browser or in the load method


    webbrowser1.scriptssuppressed = true
     
  9. christoss1959

    christoss1959 Senior Member

    Joined:
    Nov 25, 2010
    Messages:
    894
    Likes Received:
    1,150
    Home Page:
    As I said above for some reason that didn't work. I've posted above the only method that actually worked for me (not a proper solution but at least by passed the problem)