Results 1 to 4 of 4

Thread: Removing Images From Browser

  1. #1

    Thread Starter
    Addicted Member messup000's Avatar
    Join Date
    Jun 2005
    Posts
    181

    Removing Images From Browser

    Ok so heres my problem. I have an https that creates a popup because non secure http images are being stored on the website. How can I make it so that I can suspend the images from the site that I am going to. This needs to happen for my automated program to work.

    Thanks a Bunch

    messup000
    Last edited by messup000; Apr 5th, 2006 at 10:20 PM.

  2. #2

    Thread Starter
    Addicted Member messup000's Avatar
    Join Date
    Jun 2005
    Posts
    181

    Re: Removing Images From Browser

    I know that you can do it in IE but can I do it without affecting IE and make it temporary

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

    Disable Images In Webbrowser

    You can do it by changing the image locations in the DOM.
    VB Code:
    1. ' Place this code in a form and add a WebBrowser Control, _
    2. ' a picturebox and a Command button
    3. ' Set the pictureboxs appearance = Flat, BackColor = White and Visible = False
    4. Option Explicit
    5. '======================================================================
    6. Private Sub Form_Load()
    7.    
    8.     WebBrowser1.Navigate "about:blank"
    9.     Picture1.Move WebBrowser1.Left, _
    10.                  WebBrowser1.Top, _
    11.                  WebBrowser1.Width, _
    12.                  WebBrowser1.Height
    13.    
    14. End Sub
    15.  
    16. '======================================================================
    17. Private Sub Command1_Click()
    18.    
    19.     ' [b]WebBrowser1.Visible = False[/b] -> we can not use it. It has some bugs
    20.     Picture1.Visible = True
    21.     WebBrowser1.Left = Screen.Width + 1000 'move it out of screen instead
    22.     WebBrowser1.Navigate "http://www.yahoo.com"
    23.  
    24. End Sub
    25.  
    26. '======================================================================
    27. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, _
    28.        URL As Variant)
    29.    
    30.     Dim i As Integer
    31.    
    32.     'Wait till document has loaded
    33.     If pDisp = WebBrowser1 Then
    34.         'Loop through images
    35.        
    36.         For i = 0 To WebBrowser1.Document.Images.length - 1
    37.        
    38.             [b]WebBrowser1.Document.Images.Item(i).src = "C:\WINDOWS\Web\Tips.gif" 'or anything else, even a null string[/b]
    39.            
    40.         Next i
    41.     Picture1.Visible = False
    42.     WebBrowser1.Left = Picture1.Left
    43.     End If
    44.  
    45. End Sub
    46. '======================================================================
    Last edited by iPrank; Apr 6th, 2006 at 12:02 AM.
    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


  4. #4

    Thread Starter
    Addicted Member messup000's Avatar
    Join Date
    Jun 2005
    Posts
    181

    Re: Removing Images From Browser

    thanks Iprank that works but is there a way to do this before the page is loaded?

    I am loading it from a login so is there a way for the program to login and then directly maybe redirect to a different url?

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