Page 1 of 1

Ie issue in IEGET

Posted: 17 Feb 2015, 09:36
by faran
hello,

I am running 4 IE(s) sometimes they work very fine but sometimes they keep giving me these error and apps doesn work after these errors
here is my code for getting ie

Code: Select all

Run, Iexplore.exe -private -nomerge,,,PID
WinWait, ahk_pid %PID%
Sleep,1000 ;If the script doesn't work, you can try increasing this.
global Pwb := IEGet(WinExist("ahk_pid " . PID))
its opening ie fine and doing login to 4 account without any issue but when after login i try to nagivate all Ie its show me error
here are code for nagivating

Code: Select all

getit:

gui,submit,nohide
pwb.navigate(uid)
while pwb.readyState!=4 || pwb.document.readyState!="complete"
                        sleep, 100
Links := pwb.document.getElementsByTagName("a")
    Loop % Links.Length

        if InStr(Links[A_Index - 1].innerText, "get text")
{
	  links[A_Index-1].Click()
      break
}


Image
how to resolve this issue

thanks

Re: Ie issue in IEGET

Posted: 17 Feb 2015, 11:45
by faran
used
#Persistent
#SingleInstance force
at top of script but still same issue

Re: Ie issue in IEGET

Posted: 17 Feb 2015, 12:08
by jigga
Does this only happen with pwb4, or is it every ie object?

Re: Ie issue in IEGET

Posted: 17 Feb 2015, 12:12
by faran
with all pwb sometimes its show error on first pwb also


here is IEGET function

IEGet(hwnd)
{
for window in ComObjCreate("Shell.Application").Windows{
if (window.HWND == hwnd){
return window
}
}
return ""
}

Re: Ie issue in IEGET

Posted: 17 Feb 2015, 12:23
by jigga
You might want to create each IE instead of just running it:

Code: Select all

pwb[i] := ComObjCreate("InternetExplorer.Application")
Or try this method of getting an open IE:

Code: Select all

WBGet(WinTitle="ahk_class IEFrame", Svr#=1) {              
   static msg := DllCall("RegisterWindowMessage", "str", "WM_HTML_GETOBJECT")
        , IID := "{0002DF05-0000-0000-C000-000000000046}"   ;// IID_IWebBrowserApp
;//     , IID := "{332C4427-26CB-11D0-B483-00C04FD90119}"   ;// IID_IHTMLWindow2
   SendMessage msg, 0, 0, Internet Explorer_Server%Svr#%, %WinTitle%
   if (ErrorLevel != "FAIL") {
      lResult:=ErrorLevel, VarSetCapacity(GUID,16,0)
      if DllCall("ole32\CLSIDFromString", "wstr","{332C4425-26CB-11D0-B483-00C04FD90119}", "ptr",&GUID) >= 0 {
         DllCall("oleacc\ObjectFromLresult", "ptr",lResult, "ptr",&GUID, "ptr",0, "ptr*",pdoc)
         return ComObj(9,ComObjQuery(pdoc,IID,IID),1), ObjRelease(pdoc)
      }
   }
}

Re: Ie issue in IEGET

Posted: 17 Feb 2015, 12:31
by faran
i also need to unshare cookies as i m login to same site more thans once (4) times

Re: Ie issue in IEGET

Posted: 17 Feb 2015, 13:09
by jigga
From user tmplinshi:

Code: Select all

ClearCookies() {
    static CmdLine := 0x0002 | 0x0100 ; CLEAR_COOKIES | CLEAR_SHOW_NO_GUI
    static INTERNET_OPTION_END_BROWSER_SESSION := 42
    DllCall("inetcpl.cpl\ClearMyTracksByProcessW", "UInt", 0, "UInt", 0, "Str", CmdLine, "Int", 0)
    DllCall("wininet\InternetSetOption", "Int", 0, "Int", INTERNET_OPTION_END_BROWSER_SESSION, "Int", 0, "Int", 0)
}

Re: Ie issue in IEGET

Posted: 17 Feb 2015, 13:49
by tank
clearing cookies is not the same as forcing them into separate sandboxes
i suggest using noframemerging instead of nomerge
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
if you are closing alerts or modals before this action i suggest sleeping a full second after

Re: Ie issue in IEGET

Posted: 18 Feb 2015, 05:10
by faran
i didnt understand what u want to clear to me
beside nomerge is not my issue as i am login to same site 4 times without any issue

Re: Ie issue in IEGET

Posted: 18 Feb 2015, 15:11
by jethrow
Do have multiple tabs in the same window?

Re: Ie issue in IEGET

Posted: 19 Feb 2015, 05:34
by faran
nope i have all seprate windows for each IE
between i also tried noframemerging but same issue its keep showing nagivation errors :headwall: