logcomptechs Posted February 1, 2009 Share Posted February 1, 2009 The functions for Internet Explorer are nice, waiting until the page loads, then going onto the next line of code. But I hate using Internet Explorer (Horrible Search Function, among the rest of the downfalls of using Internet Explorer). So I was wondering if their was any ways I could see if a page has fully loaded in Firefox, so it knows to move on to the next line of code. If any has any kind of solution, that would be great, and thank you. Link to comment Share on other sites More sharing options...
jerem488 Posted February 1, 2009 Share Posted February 1, 2009 You can resume the autoit file and change in terms of firefox ! expandcollapse popupFunc _IELoadWait(ByRef $o_object, $i_delay = 0, $i_timeout = -1) If Not IsObj($o_object) Then __IEErrorNotify("Error", "_IELoadWait", "$_IEStatus_InvalidDataType") SetError($_IEStatus_InvalidDataType, 1) Return 0 EndIf If Not __IEIsObjType($o_object, "browserdom") Then __IEErrorNotify("Error", "_IELoadWait", "$_IEStatus_InvalidObjectType", ObjName($o_object)) SetError($_IEStatus_InvalidObjectType, 1) Return 0 EndIf Local $oTemp, $f_Abort = False, $i_ErrorStatusCode = $_IEStatus_Success ; Setup internal error handler to Trap COM errors, turn off error notification Local $status = __IEInternalErrorHandlerRegister() If Not $status Then __IEErrorNotify("Warning", "_IELoadWait", _ "Cannot register internal error handler, cannot trap COM errors", _ "Use _IEErrorHandlerRegister() to register a user error handler") Local $f_NotifyStatus = _IEErrorNotify() ; save current error notify status _IEErrorNotify(False) Sleep($i_delay) ; Local $IELoadWaitTimer = TimerInit() If $i_timeout = -1 Then $i_timeout = $__IELoadWaitTimeout Switch ObjName($o_object) Case "IWebBrowser2"; InternetExplorer While Not (String($o_object.readyState) = "complete" Or $o_object.readyState = 4 Or $f_Abort) ; Trap unrecoverable COM errors If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd While Not (String($o_object.document.readyState) = "complete" Or $o_object.document.readyState = 4 Or $f_Abort) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf ; Trap unrecoverable COM errors If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd Case "DispHTMLWindow2" ; Window, Frame, iFrame While Not (String($o_object.document.readyState) = "complete" Or $o_object.document.readyState = 4 Or $f_Abort) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf ; Trap unrecoverable COM errors If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd While Not (String($o_object.top.document.readyState) = "complete" Or $o_object.top.document.readyState = 4 Or $f_Abort) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf ; Trap unrecoverable COM errors If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd Case "DispHTMLDocument" ; Document $oTemp = $o_object.parentWindow While Not (String($oTemp.document.readyState) = "complete" Or $oTemp.document.readyState = 4 Or $f_Abort) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf ; Trap unrecoverable COM errors If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd While Not (String($oTemp.top.document.readyState) = "complete" Or $oTemp.top.document.readyState = 4 Or $f_Abort) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf ; Trap unrecoverable COM errors If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd Case Else ; this should work with any other DOM object $oTemp = $o_object.document.parentWindow While Not (String($oTemp.document.readyState) = "complete" Or $oTemp.document.readyState = 4 Or $f_Abort) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf ; Trap unrecoverable COM errors If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd While Not (String($oTemp.top.document.readyState) = "complete" Or $o_object.top.document.readyState = 4 Or $f_Abort) If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then $i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout $f_Abort = True EndIf ; Trap unrecoverable COM errors If @error = $_IEStatus_ComError And __IEComErrorUnrecoverable() Then $i_ErrorStatusCode = __IEComErrorUnrecoverable() $f_Abort = True EndIf Sleep(100) WEnd EndSwitch ; restore error notify and error handler status _IEErrorNotify($f_NotifyStatus) ; restore notification status __IEInternalErrorHandlerDeRegister() Switch $i_ErrorStatusCode Case $_IEStatus_Success SetError($_IEStatus_Success) Return 1 Case $_IEStatus_LoadWaitTimeout __IEErrorNotify("Warning", "_IELoadWait", "$_IEStatus_LoadWaitTimeout") SetError($_IEStatus_LoadWaitTimeout, 3) Return 0 Case $_IEStatus_AccessIsDenied __IEErrorNotify("Warning", "_IELoadWait", "$_IEStatus_AccessIsDenied", _ "Cannot verify readyState. Likely casue: cross-site scripting security restriction.") SetError($_IEStatus_AccessIsDenied) Return 0 Case $_IEStatus_ClientDisconnected __IEErrorNotify("Error", "_IELoadWait", "$_IEStatus_ClientDisconnected", _ "Browser has been deleted prior to operation.") SetError($_IEStatus_ClientDisconnected) Return 0 Case Else __IEErrorNotify("Error", "_IELoadWait", "$_IEStatus_GeneralError", "Invalid Error Status - Notify IE.au3 developer") SetError($_IEStatus_GeneralError) Return 0 EndSwitch EndFunc ;==>_IELoadWait I have only put the function of _IELoadWait, but this function use others function of this file. Good luck Qui ose gagneWho Dares Win[left]CyberExploit[/left] Link to comment Share on other sites More sharing options...
logcomptechs Posted February 1, 2009 Author Share Posted February 1, 2009 Place this code in the IE au3 file or in my script. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 1, 2009 Share Posted February 1, 2009 I have no idea what jerem said, but try FF.au3, specifically the func _FFLoadWait() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
FireFox Posted February 1, 2009 Share Posted February 1, 2009 Place this code in the IE au3 file or in my script. ?? Do it yourself, we dont like lazzy people, make a little effort and if youve again a problem then post your script ...Cheers, FireFox. Link to comment Share on other sites More sharing options...
logcomptechs Posted February 1, 2009 Author Share Posted February 1, 2009 ?? Do it yourself, we dont like lazzy people, make a little effort and if youve again a problem then post your script ...Cheers, FireFox.Was not asking for him to do it, sorry if sounded that way, I was just asking where do I put it, I am far from lazy. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 1, 2009 Moderators Share Posted February 1, 2009 (edited) logcomptechs,Download the FF.au3 file from the link AdmiralAlkex provided. Put it in your script using an #Include directive. Then use the _FFLoadWait() function in your script.M23 Edited February 1, 2009 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
logcomptechs Posted February 1, 2009 Author Share Posted February 1, 2009 Yep, already on it, and thank you both. Link to comment Share on other sites More sharing options...
Mars Posted February 1, 2009 Share Posted February 1, 2009 What I do for my scripts, although it might not be the most efficient is do a pixelgetcolor for the little box that appears when the page is loading. When the page is done loading the box disappears so it just loops in the pixelgetcolor until it is the right color. Link to comment Share on other sites More sharing options...
James Posted February 1, 2009 Share Posted February 1, 2009 What I do for my scripts, although it might not be the most efficient is do a pixelgetcolor for the little box that appears when the page is loading. When the page is done loading the box disappears so it just loops in the pixelgetcolor until it is the right color.Bit of a long way to do it if you ask me. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Mars Posted February 1, 2009 Share Posted February 1, 2009 Bit of a long way to do it if you ask me.Maybe, but it is a lot shorter the the script posted Link to comment Share on other sites More sharing options...
logcomptechs Posted February 2, 2009 Author Share Posted February 2, 2009 Maybe, but it is a lot shorter the the script posted I might just try that, cause the FF.au3 is all messed up, things do not work right on it, not sure it is because i have version 3.0 or what, but it just does not work right. That's a good idea and it will take me a few minutes to program that, instead of trying to fix the FF.au3 Link to comment Share on other sites More sharing options...
Stilgar Posted February 2, 2009 Share Posted February 2, 2009 What is to fix in the FF.au3? Do you have the FF-AddOn MozRepl installed, too? jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Guest KeeForm Posted February 16, 2009 Share Posted February 16, 2009 Hi logcomptechs,were your problems regarding FF.au3 solved? What solution did you try in the end? Thanks, DaveI might just try that, cause the FF.au3 is all messed up, things do not work right on it, not sure it is because i have version 3.0 or what, but it just does not work right. That's a good idea and it will take me a few minutes to program that, instead of trying to fix the FF.au3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now