Jump to content
Fórum Script Brasil
  • 0

HELP - Como usar o AlertBlocker apenas para uma mensagem..


felipegiratto

Question

Boa noite...

Gostaria de saber como usar o AlertBlocker para apenas uma mensagem no visual basic 2010

segue o código..

    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

Só que esse script bloqueia todos os alertas, e não quero bloquear todos os alertas do navegador, quero bloquear apenas um especifico alerta.. Como faço?

Agradeço desde já!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...