Results 1 to 5 of 5

Thread: Disable Javascript in Webbrowser ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    20

    Unhappy Disable Javascript in Webbrowser ?

    How to disable Javascript in a specific website ?

    Here're are links, for example :

    http://www.zillow.com/homes/11491-SL...W-RD-77385_rb/
    http://www.411.com/name/Linda-L-Hawo...ica-IN/4gqss74

    Every time my Webbrowser navigates to those links, it takes a serious time to load unnecessary things and it's really annoying. Just disable Javascript in those pages but still keep it enabled in other websites ?

    I know it's hard to do that with the default Webbrowser, but is there any way to that ? Any codes to work with the Internet Option without launching it manually through the Control Panel ?

    Thanks, I really appreciate if you could guild me

  2. #2
    Lively Member
    Join Date
    Jun 2012
    Posts
    75

    Re: Disable Javascript in Webbrowser ?

    Wrong Post.. Sorry / Free Bump :X

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    20

    Re: Disable Javascript in Webbrowser ?

    I need help, seriously.

    Quote Originally Posted by VBbbq View Post
    Wrong Post.. Sorry / Free Bump :X
    Thanks anyway

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2012
    Posts
    20

    Re: Disable Javascript in Webbrowser ?

    bump again. my question is similar to this

    Quote Originally Posted by husnainhadier View Post
    hi, i want to set internet zone setting to custom level...(high or low) with vb6
    is there any way to do this.?


    Example:
    Code:
    Sub Clear_History()
     Shell "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1"
     End Sub

    or any other way?
    help please.
    i just want to disable or enable java scripting in web browser with vb6.
    i'll do it manually and it's working perfect. but i want to do this with my project automatically with coding.
    anyone here to solve this problem.
    i have discuss this problem here.
    http://www.vbforums.com/showthread.p...45#post4102945
    but nothing.!!!

  5. #5
    Lively Member
    Join Date
    Jun 2012
    Posts
    75

    Re: Disable Javascript in Webbrowser ?

    Maybe this:

    Code:
    Public Class Form1
    
        Private Sub WebBrowser1_Navigating(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserNavigatingEventArgs) Handles WebBrowser1.Navigating
            If e.Url.Equals("http://www.zillow.com/homes/11491-SLEEPY-HOLLOW-RD-77385_rb/") OrElse e.Url.Equals("http://www.411.com/name/Linda-L-Haworth/Attica-IN/4gqss74Then") Then
                If WebBrowser1.Document.GetElementsByTagName("script").ToString <> vbNull Then
                    Dim ScriptElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("script")
                    For Each scriptElement As HtmlElement In ScriptElements
                        Dim scriptcName As String = scriptElement.GetAttribute("text").ToString
                        If scriptcName <> "" And scriptElement.GetAttribute("text").ToString <> Nothing Then
                            scriptcName = ""
                        End If
                    Next
                End If
            End If
        End Sub
    End Class
    I havent tested it, but it "should" do this:

    If webbrowser1 is navigating to website, get tag name "script", and attribute "text", then change it to nothing if valid operation.
    Last edited by VBbbq; Jul 5th, 2012 at 06:13 PM.

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