Jump to content
AlienStar

_IECreate() in private browsing mode??

Recommended Posts

AlienStar

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
AlienStar
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
Danp2
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
jguinch

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

 

  • Like 2

Share this post


Link to post
Share on other sites
AlienStar
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
AlienStar
4 hours ago, jguinch said:

Please, show your code...

Local $oIE = _IECreate("https://twitter.com/login?username_or_email=xxxxx")
while _IELoadWait($oIE)=false
    Sleep(100)
wend
Send("{TAB}")
$password = xxxxxxxxx
Send($password)
Send("{ENTER}")
Local $sHTML = _IEDocReadHTML($oIE)
MsgBox(0,"content ",$sHTML)

 

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

×