scdxorange Posted September 27, 2008 Share Posted September 27, 2008 Thanks Stilgar. I tried: $Socket = _FFStart ("about:blank") _FFSetGet($Socket, '.location.href="http://74.125.95.103"') But there is an error says "Reference error: FF_AutoItScript is not defined". Could you please correct me? Thanks! Link to comment Share on other sites More sharing options...
Stilgar Posted September 27, 2008 Share Posted September 27, 2008 If the functions are working this "error" is no problem. On the first connection from FF.au3 to FF the FF.au3 checks if there is the object " FF_AutoItScript", if not it is created by the FF.au3. You can see this in one of the next lines in the console: "__FFSend: FF_AutoItScript = new Object(); ...." jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
ProgAndy Posted September 27, 2008 Share Posted September 27, 2008 You could also use: _FFSetGet($Socket, 'content.document.location.href="' & $sIP & '"') like _FFOPenURL does *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Automania Posted September 29, 2008 Share Posted September 29, 2008 Hey all, This is really amazing. I have a few questions regarding MozLab: 1) does it not support the latest version of FF yet (3.02/3.03)? Any known workaround or so? 2) I don't understand what the plugin does but apparently it allows remote access? How secure or insecure is that to use it on a business PC? Or can it be restricted to only work with local/internal or localhost IPs? 3) No chance for Autoit + ff3.au3 to work with FF without using the Mozlab plugin? Maybe someone can give me an easy, short description how these things interact with each other and why it has to be done this way? >_< Using AutoIt v3.3.14.5 Accelerate medical research with your PC Link to comment Share on other sites More sharing options...
Stilgar Posted October 3, 2008 Share Posted October 3, 2008 1) It works with from FF V2.x up to the latest version of FF V3.0.3 and MozLab V0.2b1.2008081713 2) You can disable outside connections in the MozLab-Menu so it works only on localhost 3) Sorry, no chance. The GUI from FF is only XUL and Javascript so you can't interact with it, with normal Windows-tools. MozLab (MozRepl) gives you a telnet port to FF and via this connection the FF.au3 interact with FF. jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Automania Posted October 4, 2008 Share Posted October 4, 2008 (edited) Excellent, thanks a lot for your answers! That helped me a lot! I didn't like to use my program with IE anyway. I'm gonna check this stuff out now. Edited October 4, 2008 by Automania Using AutoIt v3.3.14.5 Accelerate medical research with your PC Link to comment Share on other sites More sharing options...
KenTurner Posted October 20, 2008 Share Posted October 20, 2008 (edited) I'm using FF.au3 (and AutoIt) for the first time, and need some help here, please. I'm using AutoIt v3.2.12.1, FF.au3 v0.2.4.0beta, SciTE v1.76, MozRepl 2008 10 12 19 and FireFox 3.0.3, on WinXP Pro Sp3. So far I've got this: #include <FF.au3> $Socket = _FFStart("http://privilege.ftlatest.com","default",2) _FFSetValueByName($Socket, "ucpnlHeader:LoginHeader_ctl1:txtCPN", "12345") _FFSetValueByName($Socket, "ucpnlHeader:LoginHeader_ctl1:txtPostCode", "aa9 5bb") _FFClickImage($Socket,"ucpnlHeader:LoginHeader_ctl1:btnSubmit","name") The last few lines of the SciTE log look like this: __FFSend: content.wrappedJSObject.frames["top"].document.getElementsByName("ucpnlHeader:LoginHeader_ctl1:txtCPN")[0].value="12345" __FFRecv: 12345 __FFSend: content.wrappedJSObject.frames["top"].document.getElementsByName("ucpnlHeader:LoginHeader_ctl1:txtPostCode")[0].value="aa9 5bb" __FFRecv: aa9 5bb __FFSend: FF_AutoItScript.SearchImageLink(/name[ \t]*=[ \t]*(.*)ucpnlHeader:LoginHeader_ctl1:btnSubmit/,"top") __FFRecv: -1 _FFClickImage ==> No match: ucpnlHeader:LoginHeader_ctl1:btnSubmit +>13:05:47 AutoIT3.exe ended.rc:0I tried using the FF Page Analyzer, but couldn't find the login button on my web page. I therefore looked directly at the page source from the page http://privilege.ftlatest.com/home.aspx?id_content=1, and found this line: <input type="image" name="ucpnlHeader:LoginHeader_ctl1:btnSubmit" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " id="ucpnlHeader_LoginHeader_ctl1_btnSubmit" class="btn" src="/images/btn-login.gif" alt="" border="0" /><BR> so I used the value of the name property in my _FFClickImage statement. The two _FFSetValueByName lines appear to be working perfectly, but what is wrong with the _FFClickImage statement? Edited October 20, 2008 by KenTurner Link to comment Share on other sites More sharing options...
misjdd Posted October 29, 2008 Share Posted October 29, 2008 cross-domain security issue ... I am having the same problem. Ok, I see that you added the frame support, but there is no documentation and I cannot seem to get it to work. I decided to use it on one of my old myspace bots, and I tried to change it from using my old method of having the window sized exactly and hidden, and using the control commands. I can get into the app perfectly, easier then the hours it first took me, but when I get to the app window, and it pulls up the app's frame, I cant get into it. I am simply searching for a term inside it the frame "REFRESH" in this case, and trying every single frame ID possible. Something like this: MsgBox(0,_FFFrameSelected($Socket),_FFAction($Socket,"search","REFRESH")) _FFFrameEnter($Socket, 1) _FFClickLink($Socket, "REFRESH", "text") _FFClick($Socket, "Missions", "text") MsgBox(0,_FFFrameSelected($Socket),_FFAction($Socket,"search","REFRESH")) _FFFrameEnter($Socket,2) _FFClickLink($Socket, "REFRESH", "text") _FFClick($Socket, "Missions", "text") MsgBox(0,_FFFrameSelected($Socket),_FFAction($Socket,"search","REFRESH")) _FFFrameEnter($Socket,3) _FFClickLink($Socket, "REFRESH", "text") _FFClick($Socket, "Missions", "text") MsgBox(0,_FFFrameSelected($Socket),_FFAction($Socket,"search","REFRESH")) _FFFrameEnter($Socket,4) _FFClickLink($Socket, "REFRESH", "text") _FFClick($Socket, "Missions", "text") MsgBox(0,_FFFrameSelected($Socket),_FFAction($Socket,"search","REFRESH")) _FFFrameEnter($Socket,5) _FFClickLink($Socket, "REFRESH", "text") _FFClick($Socket, "Missions", "text") MsgBox(0,_FFFrameSelected($Socket),_FFAction($Socket,"search","REFRESH")) But the clicks do not happen and the search always returns false. Any ideas? Link to comment Share on other sites More sharing options...
trinitrotoluen Posted January 4, 2009 Share Posted January 4, 2009 How can I extract the text in Firefox ? Link to comment Share on other sites More sharing options...
FireFox Posted January 4, 2009 Share Posted January 4, 2009 @stilgar Awesome work ! Im happy to see that someone have took time to work on me Cheers, FireFox. Link to comment Share on other sites More sharing options...
trinitrotoluen Posted January 5, 2009 Share Posted January 5, 2009 How can I extract text in FF and store it into the variable Link to comment Share on other sites More sharing options...
Stilgar Posted January 5, 2009 Share Posted January 5, 2009 @KenTurner: Sorry for the late answer ... I don't know why, but you can see the <input type="image" in the Dome from FF. So the only thing you can try is to submit the form with _FFFormSubmit or with _FFClick. @FireFox: Thank you! @trinitrotoluen: If you mean the whole text of the page: $sText = _FFReadText($Socket) jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted January 5, 2009 Share Posted January 5, 2009 @trinitrotoluen:If you mean the whole text of the page:$sText = _FFReadText($Socket)No, I only want to extract text that i have search Link to comment Share on other sites More sharing options...
trinitrotoluen Posted January 5, 2009 Share Posted January 5, 2009 Ok, I found that : $Get = _FFSetGet ($Socket, 'content.window.getSelection().toString()') p/s : Where I can learn the FF java scripts like the script above. Link to comment Share on other sites More sharing options...
trinitrotoluen Posted January 5, 2009 Share Posted January 5, 2009 Ok, I found that : $Get = _FFSetGet ($Socket, 'content.window.getSelection().toString()') p/s : Where I can learn the FF java scripts like the script above.Oh no ! It don't work it with Frames in Firefox and the copy func _FFSetGet ($Socket, 'content.window.getSelection()') don't work with frames, either. Link to comment Share on other sites More sharing options...
ProgAndy Posted January 5, 2009 Share Posted January 5, 2009 (edited) you could write a function if selection is empty, nothing or whatever, loop window.frames[] and use window.frames[index].getSelection(); possibly this way: $sJavascript = 'FF_AutoItScript.getSelection = function getSelection()' $sJavascript &= '{ var selection;' $sJavascript &= 'selection = content.window.getSelection();' $sJavascript &= 'if (selection == nothing) { ' $sJavascript &= 'for (i=0;i<content.window.frames.length;i++)' $sJavascript &= '{' $sJavascript &= ' selection = content.window.frames[i].getSelection();' $sJavascript &= ' if (! (selection == nothing) ) return selection.toString();' $sJavascript &= '} else{ ' $sJavascript &= ' return selection.toString(); ' $sJavascript &= '} return ""; ' $sJavascript &= '}};' _FFSetGet($Socket, $sJavascript,1000) $sel= _FFSetGet($Socket, "FF_AutoItScript.getSelection();",1000) Edited January 5, 2009 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Stilgar Posted January 5, 2009 Share Posted January 5, 2009 (edited) Or the same in AutoIt#region Includes #include <FF.au3> #endregion Includes $Socket = _FFStart("http://thorsten-willert.de",default,2) If $Socket <> -1 Then For $i = 0 To _FFGetLength($Socket,"frames") _FFFrameEnter($Socket,$i) If Not @error Then If _FFAction($Socket,"search","Neues") Then $sText = _FFSetGet ($Socket, '.getSelection().toString()') If $sText <> "" Then msgbox(64,"", $sText) EndIf EndIf Next _FFDisConnect($Socket) EndIf@trinitrotoluen:You can look for the Javascript-code + DOM reference here:https://developer.mozilla.org/en/Gecko_DOM_Reference Edited January 5, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted January 5, 2009 Share Posted January 5, 2009 @ProgAndy,Stilgar : thanks you very much, I will keep trying Link to comment Share on other sites More sharing options...
trinitrotoluen Posted January 6, 2009 Share Posted January 6, 2009 Is it possible to control multi Firefoxs with difference profiles at the same time ? Because I see that the socket when I open difference Firefox's profile is the same (_FFConnect: Socket: 1624) so I wanna ask if it is possible to recognize multi Firefox profile windows at the same time. Link to comment Share on other sites More sharing options...
Stilgar Posted January 6, 2009 Share Posted January 6, 2009 Yes it's possible. If you change the default port-number and profile from FF with _FFStart you can do this. _FFStart ([$sURL = "about: blank" [, $sProfile = "default" [, $iMode = 1 [, $bHide = False [, $IP = "127.0.0.1" [, $iPort = 4242]]] ]]]) Or you can control the same FF-window with different programms/connections via different sockets ... but this is an other thing jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Recommended Posts