Sign in to follow this  
Followers 0
Ebenezer

Preventing Ie From Loading Pictures ?

5 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Thanks a lot :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

:">

Sigh, this Forum always makes me feel so inadequate. Now my questions are answered, before I even ask them :think:

Thanks again for your help

Share this post


Link to post
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
Sign in to follow this  
Followers 0