Jump to content

Preventing Ie From Loading Pictures ?


Recommended Posts

Hi all.

Quick question. Is there a way to prevent the window opened via _IECreate from loading pictures. I analyze multiple image-heavy pages for keywords. Excluding the pics would speed the whole script up significantly.

It probably wouldn't be a good idea to edit the IE settings directly, since the user might want to use the browser to surf while the script is running. Might employ it as a second best solution, though if there is no other way :)

Thanks, Ebenezer

Link to comment
Share on other sites

  • Moderators

Hi all.

Quick question. Is there a way to prevent the window opened via _IECreate from loading pictures. I analyze multiple image-heavy pages for keywords. Excluding the pics would speed the whole script up significantly.

It probably wouldn't be a good idea to edit the IE settings directly, since the user might want to use the browser to surf while the script is running. Might employ it as a second best solution, though if there is no other way :)

Thanks, Ebenezer

I think this accomplishes what you are wanting, besides being able to surf while the script is running:

#include <IE.au3>

Opt("WinTitleMatchMode", 2)
Opt("WinWaitDelay", 100)
Opt("OnExitFunc", "Toggle_Images")

Toggle_Images()
$oIE = _IECreate ()
_IENavigate ($oIE, "http:\\www.google.com")
While WinExists("Internet Explorer")
    Sleep(250)
WEnd

Func Toggle_Images()
    
    $oIE = _IECreate (0)
    WinWait("about:blank")
    Sleep(250)
    ControlSend("about:blank", "", "ToolbarWindow324", "!t")
    ControlSend("about:blank", "", "ToolbarWindow324", "o")
    WinWait("Internet Options")
    WinSetState("Internet Options", "", @SW_HIDE)
    For $i = 1 To 6
        ControlCommand("Internet Options", "", "SysTabControl321", "TabRight", "")
    Next
    Sleep(250)
    ControlSend("Internet Options", "", "SysTreeView321", "{PGDN 3}{DOWN}{SPACE}")
    ControlClick("Internet Options", "", "Button2")
    WinWaitClose("Internet Options")
    WinClose("about:blank")
    
EndFunc ;==>Toggle_Images
Edited by big_daddy
Link to comment
Share on other sites

  • Moderators

Thanks a lot :)

No problem, but I would suggest using this instead.

#include <IE.au3>

Opt("WinTitleMatchMode", 2)

Toggle_Images(1)
$oIE = _IECreate ()
_IENavigate ($oIE, "http:\\www.google.com")
While WinExists("Internet Explorer")
    Sleep(250)
WEnd
Toggle_Images()

Func Toggle_Images($On_Off=0)
    If $On_Off == 0 Then
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "yes")
    Else
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Display Inline Images", "REG_SZ", "no")
    EndIf   
EndFunc  ;==>Toggle_Images
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...