CharlesStamp Posted April 14, 2009 Posted April 14, 2009 (edited) Hi. I've been trying this for about a week and found it easy enough to get to grips with, but I'm having real problems getting the FF.au3 UDF to work with MozRepl. I'm running FireFox 2.0.2 with Mozlab, and I've put FF.au3 in my Includes folder. I've checked that MozRepl is running on port 4242, but the only command that seems to work is _FFStart. When I try running the script below, I just get the message "Disconnected from FireFox" after a few seconds. #Include <FF.au3> ; trying to connect to a running FireFox with MozRepl on If _FFConnect(Default, Default, 3000) Then ; open a page _FFOpenURL("http://ff-au3-example.thorsten-willert.de/") Sleep(3000) ; disconnect from FireFox If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!") Else MsgBox(64, "", "Can't connect to FireFox!") EndIf and the one next one just opens a new FireFox window. #Include <FF.au3> _FFStart() If _FFIsConnected() Then ; add a new tab with an URL _FFTabAdd("http://ff-au3-example.thorsten-willert.de/") sleep(3000) ; add a new blank tab and bring it to front _FFTabAdd(default,true) Sleep(3000) ; select the tab with "FF" in the label _FFTabGetSelected("FF","label") ; shows the number of tabs MsgBox(64,"Number of tabs:",_FFTabGetLength()) ; closing all tabs except the current _FFTabCloseAll() Sleep(3000) ; closes FireFox _FFQuit() EndIf So if anyone has any ideas, I'd be grateful. Edited April 15, 2009 by CharlesStamp
Developers Jos Posted April 14, 2009 Developers Posted April 14, 2009 What did you expect with the first script to happen? It seems to me you do a FFDisconnect() after 3 seconds and get on a successful disconnect that MsgBox(). SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
KaFu Posted April 14, 2009 Posted April 14, 2009 Wrong syntax, you need to ref to the socket... #Include <FF.au3> $MozRepl_Port = 4242 $Socket = _FFConnect("127.0.0.1", $MozRepl_Port, 500) If $Socket = -1 Then MsgBox(0,"Error", "Error connecting to Firefox!") Else _FFOpenURL($Socket, "http://ff-au3-example.thorsten-willert.de/", True) Sleep(3000) If _FFDisConnect($Socket) Then MsgBox(64, "", "Disconnected from FireFox!") endif OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Stilgar Posted April 14, 2009 Posted April 14, 2009 Wrong syntax, you need to ref to the socket... #Include <FF.au3> $MozRepl_Port = 4242 $Socket = _FFConnect("127.0.0.1", $MozRepl_Port, 500) If $Socket = -1 Then MsgBox(0,"Error", "Error connecting to Firefox!") Else _FFOpenURL($Socket, "http://ff-au3-example.thorsten-willert.de/", True) Sleep(3000) If _FFDisConnect($Socket) Then MsgBox(64, "", "Disconnected from FireFox!") endif I've removed all socket-parameters in V0.5.0.0. @CharlesStamp: What's the output in your editor console/output ? jEdit4AutoIt PlanMaker_UDF
KaFu Posted April 14, 2009 Posted April 14, 2009 I've removed all socket-parameters in V0.5.0.0., nice to know, will check it out... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
CharlesStamp Posted April 15, 2009 Author Posted April 15, 2009 @ Stilgar Running this... #Include <FF.au3> ; trying to connect to a running FireFox with MozRepl on If _FFConnect(Default, Default, 3000) Then ; open a page _FFOpenURL("http://ff-au3-example.thorsten-willert.de/") Sleep(3000) ; disconnect from FireFox If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!") Else MsgBox(64, "", "Can't connect to FireFox!") EndIf just shows the "disconnected.." message, and the editor output is shown below. >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\AutoIt3\Examples\isffconnected.au3" _FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3 _FFConnect: AutoIt: 3.3.0.0 _FFConnect: FF.au3: 0.5.3.0b-9 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 1688 _FFConnect: Browser: !!! Trying to load a non-local URI. _FFSendJavascripts: Sending functions to FireFox ........... done _FFOpenURL: http://ff-au3-example.thorsten-willert.de/ __FFSend: try{window.content.frames["top"].document.location.href="http://ff-au3-example.thorsten-willert.de/";}catch(e){'_FFCmd_Err';}; __FFRecv: !!! Trying to load a non-local URI. _FFOpenURL ==> No match: http://ff-au3-example.thorsten-willert.de/ _FFDisConnect: disconnected >Exit code: 0 Time: 6.995 Not sure what the output means, but I expected it to go to your site in Firefox which was already running. Thanks for taking a look at this Stilgar.
Stilgar Posted April 15, 2009 Posted April 15, 2009 @ Stilgar Running this... #Include <FF.au3> ; trying to connect to a running FireFox with MozRepl on If _FFConnect(Default, Default, 3000) Then ; open a page _FFOpenURL("http://ff-au3-example.thorsten-willert.de/") Sleep(3000) ; disconnect from FireFox If _FFDisConnect() Then MsgBox(64, "", "Disconnected from FireFox!") Else MsgBox(64, "", "Can't connect to FireFox!") EndIf just shows the "disconnected.." message, and the editor output is shown below. >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Program Files\AutoIt3\Examples\isffconnected.au3" _FFConnect: OS: WIN_XP WIN32_NT 2600 Service Pack 3 _FFConnect: AutoIt: 3.3.0.0 _FFConnect: FF.au3: 0.5.3.0b-9 _FFConnect: IP: 127.0.0.1 _FFConnect: Port: 4242 _FFConnect: Delay: 2ms _FFConnect: Socket: 1688 _FFConnect: Browser: !!! Trying to load a non-local URI. _FFSendJavascripts: Sending functions to FireFox ........... done _FFOpenURL: http://ff-au3-example.thorsten-willert.de/ __FFSend: try{window.content.frames["top"].document.location.href="http://ff-au3-example.thorsten-willert.de/";}catch(e){'_FFCmd_Err';}; __FFRecv: !!! Trying to load a non-local URI. _FFOpenURL ==> No match: http://ff-au3-example.thorsten-willert.de/ _FFDisConnect: disconnected >Exit code: 0 Time: 6.995 Not sure what the output means, but I expected it to go to your site in Firefox which was already running. Thanks for taking a look at this Stilgar. The problem seems to be there: "!!! Trying to load a non-local URI." this error appears in FireFox (if you search the web) with some AddOns (Megaupload, Chickenfoot ...). Can you use FireFox normaly? Have you any AddOns installed? Can you try it with a new FF profile only with MozRepl installed, please? jEdit4AutoIt PlanMaker_UDF
CharlesStamp Posted April 15, 2009 Author Posted April 15, 2009 Can you try it with a new FF profile only with MozRepl installed, please?I've just tried it and the result is the same. There's a pause, then "Disconnected from Firefox". This was on a new profile with only the standard add-ons and MozLab installed and running. I'll try it later today with a completely fresh FF install.Also, can anybody confirm whether MozLab requires a US Localized version of FF? I think I read that somewhere, but I'm not sure. Thanks again.
Stilgar Posted April 15, 2009 Posted April 15, 2009 (edited) ...Also, can anybody confirm whether MozLab requires a US Localized version of FF? I think I read that somewhere, but I'm not sure. Thanks again.I've never read this anywhere.I know that it works with the german, us and french version.But look at the project-page: http://hyperstruct.net/projects/mozlabFor the other error:Have you the Addon for Megaupload installed? Edited April 15, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF
CharlesStamp Posted April 15, 2009 Author Posted April 15, 2009 No, I've never installed the Megaupload add-on, and the only ones I had were the default Firefox ones. I've also erased FF and reinstalled FF2, but no success. I don't think MozLab works with the latest version of FF3 otherwise I'd try that. To add to that, running the same script on a different PC (FF2, Skype and screengrab extensions installed, but both disabled) results in the message "can't connect to Firefox" and included the following output _FFConnect ==> General Error: Tried to connect to a non browser-window I don't mean to complicate things by discussing two separate issues on two different installations, but I thought it might help shed some light on the problem.
Stilgar Posted April 15, 2009 Posted April 15, 2009 No, I've never installed the Megaupload add-on, and the only ones I had were the default Firefox ones. I've also erased FF and reinstalled FF2, but no success. I don't think MozLab works with the latest version of FF3 otherwise I'd try that. To add to that, running the same script on a different PC (FF2, Skype and screengrab extensions installed, but both disabled) results in the message "can't connect to Firefox" and included the following output _FFConnect ==> General Error: Tried to connect to a non browser-window I don't mean to complicate things by discussing two separate issues on two different installations, but I thought it might help shed some light on the problem. Oh, I see. I don't know if this combination works with FF2. For FF3 you need MozRepl. jEdit4AutoIt PlanMaker_UDF
CharlesStamp Posted April 15, 2009 Author Posted April 15, 2009 I thought it might be a noobish error I've got MozRepl for FF3 and it works perfectly. Thanks for your help Stilgar, and everybody else. Sorry for wasting your time, but hopefully I'll come up with some good scripts to make up for it.
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