Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

FF.au3 (V0.6.0.1b-10)


  • Please log in to reply
613 replies to this topic

#601 Rickname

Rickname

    Wayfarer

  • Active Members
  • Pip
  • 79 posts

Posted 09 July 2014 - 07:21 PM

I downloaded FF.au3 , installed MozRepl, started it, put 4242 as port in it, then when Im trying to run this simple script :

#include "FF.au3"
_FFConnect(default,Default,6000)

_FFWindowOpen("http://www.youtube.com", True, True)

The thing is, it actually works, but it is still gives me a very annoying error :

 

 

_FFConnect: OS:    WIN_7 WIN32_NT 7601 Service Pack 1
_FFConnect: AutoIt:    3.3.12.0
_FFConnect: FF.au3:    0.6.0.1b-10
_FFConnect: IP:    127.0.0.1
_FFConnect: Port:    4242
_FFConnect: Delay:     2ms
_FFConnect: Socket:     488
_FFConnect: Browser:    Mozilla/5.0 (Windows NT 6.1; rv:30.0) Gecko/20100101 Firefox/30.0
__FFSendJavaScripts: Sending functions to FireFox .......... done
_FFWindowOpen: http://www.youtube.com
_FFLoadWait: .
__FFWaitForRepl ==> Error TCPSend / TCPRecv: TCPRecv :-1

__FFWaitForRepl ==> Error TCPSend / TCPRecv: TCPRecv :-1
. loaded in 573ms
[object XrayWrapper [object HTMLDocument]] - {location: {...}, SWFUpload_0: function() {...}, rss_feed: {...}, getElementsByName: function() {...}, getItems: function() {...}, open: function() {...}, close: function() {...}, ...}
_FFWindowGetHandle: 0x00000000
_FFWindowGetHandle ==> General Error

 

What can do ? :(









#602 Iczer

Iczer

    Prodigy

  • Active Members
  • PipPipPip
  • 159 posts

Posted 10 July 2014 - 05:24 PM

See suggested changes in http://www.autoitscript.com/forum/topic/161918-ffau3-mozrepl-error/#entry1176017



#603 Gonnosuke

Gonnosuke

    Seeker

  • Active Members
  • 10 posts

Posted 11 July 2014 - 08:17 AM

I don't know if anyone will find this useful but I recently had to automate a process that required a private browsing session and ended up writing the following function. If anyone knows how to enable private browsing via FFCmd I'd love to know. I tried and failed to get it working properly and ended up with the following method which is probably much slower than it would be if called directly.

AutoIt         
; #INTERNAL_USE_ONLY# ========================================================== ; Name ..........: _FFStartPrivate ; Description ...: Starts Private browsing session ; AutoIt Version : V3.3.10.2 ; Syntax ........: _FFStartPrivate([$sURL = "about:blank"[, $bNewWin = True[, $bPrivSession = True[, $iPort = 4242]]]]) ; Parameter(s): . ;                  $bNewWin     - Optional: (Default = True) : ;                  $bPrivSession  - Optional: (Default = True) : ;                  $iPort       - Optional: (Default = 4242) : ; Return Value: Success      - 1 ;                  Failure      - 0 ;                  @ERROR       - ;                  @EXTENDED    - hWnd from Private firefox session ; Date ..........:  6/7/2014 ; ============================================================================== Func _FFStartPrivate($sURL = "about:blank", $bNewWin = True, $bPrivSession = True, $iPort = 4242)     Local Const $sFuncName = "_FFStartPrivate"     Local $sPrivSession = ""     Local $sNewWin = ""     If $bPrivSession Then $sPrivSession = "-private-window"     If $bNewWin Then $sNewWin = "-new-window"     $sURL = '"' & $sURL & '"'     Local $sHKLM = 'HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox'     If @OSArch <> 'X86' Then $sHKLM = 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox'     Local $sFFVerKey = $sHKLM & '\' & RegEnumKey($sHKLM, 1)     Local $sFFExe = RegRead($sFFVerKey & '\Main', 'PathToExe')     If @error Then         SetError(__FFError($sFuncName, $_FF_ERROR_GeneralError, "Error reading registry entry for FireFox." & @CRLF & _                 $sFFVerKey & "\Main\PathToExe" & @CRLF & _                 "Error from RegRead: " & @error))         Return 0     EndIf         Local $sCommand = StringFormat('"%s" %s %s %s "-repl %i"', $sFFExe, $sNewWin, $sPrivSession, $sURL, $iPort)     Run($sCommand)         Local $sPrivhWnd = WinWaitActive("[REGEXPTITLE:(?i)(.*Private Browsing.*)]", "", 10)     Sleep(250)     $sCmdWinSelect = 'Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser")'     _FFCmd("repl.enter(" & $sCmdWinSelect & ")")        WinActivate($sPrivhWnd)     SetExtended($sPrivhWnd)         If $_FF_COM_TRACE Then         ConsoleWrite(@CRLF & '_FFStartPrivate: "' & $sCommand)         ConsoleWrite(@CRLF & '_FFStartPrivate hWnd: "' & $sPrivhWnd & @CRLF)     EndIf         If @error Then         SetError(__FFError($sFuncName, $_FF_ERROR_GeneralError, "Error launching Private session."))         Return 0     Else         Return 1     EndIf EndFunc   ;==>_FFStartPrivate

Regards,

Gonnosuke


Edited by Gonnosuke, 11 July 2014 - 08:20 AM.

  • Danp2 likes this

#604 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 851 posts

Posted 12 July 2014 - 02:38 PM

Here's an enhanced version of _FFWindowOpen that supports private browsing. FYI, I have not tested to see how this update may affect other functions. Let me know if you see any issues.

AutoIt         
; #FUNCTION# =================================================================== ; Name ..........: _FFWindowOpen ; Description ...: Opens a new browser window ; Beschreibung ..: Öffnet ein neues Browser Fenster. ; Syntax ........: _FFWindowOpen([$sURL = "about:blank"[, $bActivate = True[, $bLoadWait = True]]]) ; Parameter(s): .: $sURL        - Optional: (Default = "about:blank") : ;                  $bActivate   - Optional: (Default = True) ;                  $bLoadWait   - Optional: (Default = True) : ;                  $bPrivate   - Optional: (Default = False) : ; Return Value ..: Success      - 1 and sets ;                  @EXTENDED    - Window handle ;                  Failure      - 0 and sets ;                  @ERROR       - ;                  @EXTENDED    - "" ; Author(s) .....: Thorsten Willert ; Date ..........: Fri Nov 13 18:31:06 CET 2009 ; Link ..........: https://developer.mozilla.org/En/DOM/Window, https://developer.mozilla.org/En/NsIWindowMediator ; Related .......: _FFWindowSelect, _FFWindowClose, _FFWindowGetHandle ; Example .......: Yes ; ============================================================================== Func _FFWindowOpen($sURL = "about:blank", $bActivate = True, $bLoadWait = True, $bPrivate = False)     Local Const $sFuncName = "_FFWindowOpen"     If Not __FFCheckURL($sURL) Then         SetError(__FFError($sFuncName, $_FF_ERROR_InvalidDataType, "(URL) $sURL: " & $sURL))         Return 0     EndIf     Local $bTrace = $_FF_COM_TRACE     $_FF_COM_TRACE = False     ConsoleWrite("_FFWindowOpen: " & $sURL & @CRLF)     If $bPrivate Then         _FFCmd("window.PrivateBrowsingUtils.privacyContextFromWindow(window).usePrivateBrowsing = true")     Else         _FFCmd("window.PrivateBrowsingUtils.privacyContextFromWindow(window).usePrivateBrowsing = false")     EndIf     _FFCmd("window.open('" & $sURL & "');")     If $bLoadWait Then _FFLoadWait()     If Not @error Then         If _FFWindowSelect() Then             Local $hWin = @extended             If Not @error And $bActivate Then WinActivate($hWin)             __FFSendJavaScripts()             $_FF_COM_TRACE = $bTrace             SetExtended($hWin)             Return 1         EndIf     EndIf     $_FF_COM_TRACE = $bTrace     SetExtended("")     Return 0 EndFunc   ;==>_FFWindowOpen

  • 232showtime and Gonnosuke like this

#605 Gonnosuke

Gonnosuke

    Seeker

  • Active Members
  • 10 posts

Posted 18 July 2014 - 05:16 AM

Thanks Danp2! I was using the wrong context.

 

[Edit] I found a big problem with it -- when you use _FFWindowOpen like above (or if you send keys Ctrl-Shift-P), it creates a private session that really isn't private and I think the reason is that it shares the PID with existing FF windows. For example, the reason I need to use a private session is because I don't want users to be able to save the password information in the browser (among other things). With your function, if I automate the login, do what I need to do, and then close the private session window, the login info is stored when I go back to the site in question. If I use the original function I wrote (which is based on the __FFStartProcess function) it works like it should and the login info isn't stored from session to session. I suspect it's a bug with FF and the way it's initializing the new window.


Edited by Gonnosuke, 18 July 2014 - 05:31 AM.


#606 IAHIM

IAHIM

    Seeker

  • Active Members
  • 26 posts

Posted 31 July 2014 - 09:10 PM

Maybe is just me being stupid... but is this UDF compatible with Firefox 30?

Or maybe MozRepl is not compatible with my Firefox.

Anyone using this FF.au3 at the moment?

 

Thanks in advance.



#607 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 851 posts

Posted 31 July 2014 - 09:33 PM

Yes, it's working fine. What issues are you having?



#608 doinguyen

doinguyen

    Seeker

  • Active Members
  • 17 posts

Posted 04 August 2014 - 12:46 AM

Dear,

 

I have issue when i run file .au3 include <FF.au3> & <FF_AutoLogin.au3> that is ok, but when run file .exe ( compile from file .au3 ) then error..

 

kSRu9q.jpg

 

Please help me..

 

Tks a lot



#609 doinguyen

doinguyen

    Seeker

  • Active Members
  • 17 posts

Posted 09 August 2014 - 05:16 AM

Anybody dont have that issue ?



#610 jchd

jchd

    Whatever your capacity, resistance is futile.

  • MVPs
  • 5,144 posts

Posted 09 August 2014 - 05:24 AM

Which AutoIt version are you using?


SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!

SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)

An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.

 

SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.

 

PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

RegExp tutorial: enough to get started

Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.


#611 doinguyen

doinguyen

    Seeker

  • Active Members
  • 17 posts

Posted 09 August 2014 - 07:41 AM

I use ver 3.3.12.

Last i use ver 3.3.6.1 so normail 

 

Tks Jchd reply



#612 Danp2

Danp2

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 851 posts

Posted 09 August 2014 - 12:01 PM

Have you tried this solution?



#613 doinguyen

doinguyen

    Seeker

  • Active Members
  • 17 posts

Posted 10 August 2014 - 10:31 AM

Have you tried this solution?

Thanks Danp2 so much...

That solution fix my issue



#614 JWW

JWW

    Seeker

  • Normal Members
  • 4 posts

Posted 21 August 2014 - 03:46 PM

Does anyone have an updated FF.au3 with all of the changes/updates that have been provided to fix it? The ones I have found and changed:

Thanks! Btw, I have attached mine with the above changes in case anyone wants to use it. Well, I don't see an option to attach, so here's a Dropbox link: https://www.dropbox.com/s/a82h566y3c3x2r3/FF.au3

 

 

 

John






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users