AlienStar

_IECreate() in private browsing mode??

8 posts in this topic

#1 ·  Posted

hello everybody

I wanna use _IECreate() function with private browsing mode

how to do this please ??

Share this post


Link to post
Share on other sites



#2 ·  Posted

Maybe this thread will help you.

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

4 minutes ago, Danp2 said:

Maybe this thread will help you.

 

in my app I need to open a page in _IECreate() then close then re-open

is there anyway to edit IE.au3 to add -private parameter ??

Edited by AlienStar

Share this post


Link to post
Share on other sites

#4 ·  Posted

31 minutes ago, AlienStar said:

in my app I need to open a page in _IECreate() then close then re-open

is there anyway to edit IE.au3 to add -private parameter ??

Not AFAIK. You could create your own function (_IECreatePrivate or whatever) to do what you need.

Share this post


Link to post
Share on other sites

#5 ·  Posted

Try this one :

#Include <IE.au3>

$oIE = _IECreatePrivate("http://www.autoitscript.com")


Func _IECreatePrivate($sUrl = "about:blank", $iWait = 1)
    Local $sPFDir = (StringInStr(@OSArch, "64") AND Not @AutoItX64) ? RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") : @ProgramFilesDir
    ShellExecute ($sPFDir & "\Internet Explorer\iexplore.exe", "-noframemerging -private " & $sUrl, @ProgramFilesDir & "\Internet Explorer")
    Local $hPrivateIE = WinWaitActive("[REGEXPTITLE:.+\[InPrivate\]]", "", 3)
    If Not $hPrivateIE Then Return SetError(1, 0, 0)
    Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd")
    If @error Then Return SetError(2, 0, 0)
    If $iWait Then _IELoadWait($oPrivateIE)
    Return $oPrivateIE
EndFunc

 

2 people like this

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

4 hours ago, jguinch said:

Try this one :

#Include <IE.au3>

$oIE = _IECreatePrivate("http://www.autoitscript.com")


Func _IECreatePrivate($sUrl = "about:blank", $iWait = 1)
    Local $sPFDir = (StringInStr(@OSArch, "64") AND Not @AutoItX64) ? RegRead("HKLM64\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") : @ProgramFilesDir
    ShellExecute ($sPFDir & "\Internet Explorer\iexplore.exe", "-noframemerging -private " & $sUrl, @ProgramFilesDir & "\Internet Explorer")
    Local $hPrivateIE = WinWaitActive("[REGEXPTITLE:.+\[InPrivate\]]", "", 3)
    If Not $hPrivateIE Then Return SetError(1, 0, 0)
    Local $oPrivateIE = _IEAttach($hPrivateIE, "hwnd")
    If @error Then Return SetError(2, 0, 0)
    If $iWait Then _IELoadWait($oPrivateIE)
    Return $oPrivateIE
EndFunc

 

thanks so much :) it works fine but I can't use other IE functions according to  this function

_IECreatePrivate

I need to use :

_IEDocReadHTML($oIE)
_IELoadWait($oIE)

they don't work

Edited by AlienStar

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