Results 1 to 3 of 3

Thread: HELP - how to disable the alert javascript just a text

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2015
    Posts
    4

    Question HELP - how to disable the alert javascript just a text

    I would like to know how to use alertblocker to only one message

    Code:
        Private Sub WebBrowser1_StatusTextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.StatusTextChanged
            On Error Resume Next
            Dim head As HtmlElement = WebBrowser1.Document.GetElementsByTagName("head")(0)
            Dim script As HtmlElement
            script = WebBrowser1.Document.CreateElement("script")
            script.SetAttribute("type", "text/javascript")
            Dim alertBlocker As String = "window.alert = function () { }; window.confirm=function () { }; "
            script.SetAttribute("text", alertBlocker)
            head.AppendChild(script)
        End Sub
    But only for a message...

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,464

    Re: HELP - how to disable the alert javascript just a text

    You need to explain the situation better. Do you just want to block one alert during the run time of your application?

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2015
    Posts
    4

    Re: HELP - how to disable the alert javascript just a text

    Yes, but only a alert, has two alerts, and just want to block one of them

Tags for this Thread

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