Stilgar Posted May 25, 2009 Share Posted May 25, 2009 (edited) UDF to control FireFox via MozRepl:Edit-> Please see new FF.au3 Thread for updates past V0.6.0.1b-10.FF.au3 (V0.6.0.1b-10)ChangelogChanges since V0.6.0.0b:V0.6.0.1b-10 - Added: __IsIP: IPV6 Support (IVP6, HexCompressed, 6Hex4Dec, Hex4DecCompressed) V0.6.0.1b-9 - Added: __FFStartProcess: 64bit support - Added: __FFIsURL: support for intranet - Changed: _FFQuit now closes FireFox with multiple windows - Fixed: Connection-limit to MozRepl V0.6.0.1b-8 (by Danp2) - Changed: _FFTabExists to allow search by href - Changed: _FFTabSetSelected to allow selection by href - Changed: SelectWin to check individual tabs - Added: FFau3.SearchTabURL helper function - Fixed: __FFStartProcess - Fixed: _FFGetPosition V0.6.0.1b-7 - New: Internal function: __FFMultiDispatchEvent: Dispatches multiple events on one element - Added: _FFDisPatchEvent can now simulate MouseEvents: click, mousedown, mouseup, mouseover, mousemove, mouseout - Added: Global constants $_FF_Event_* - Changed: Removed connection-limit to MozRepl - Optimized: __FFFilterString - Optimized: __FFB2S (Bool to string) - Optimized: __FFIsIP V0.6.0.1b-6 - Added: Internal function __FFSetTopDocument() - Changed: Default values for _FFXpath: _FFXPath($sQuery, $sAttribute = "", $iReturnType = 9, $iFilter = 0) - Changed/Fixed: _FFSearch($sSearchString[, $bCaseSensitive = False[, $bWholeWord = False[, $bSearchInFrames = True]]]) !!! Now you can use as $sSearchString RegExp, too! - Fixed: _FFAction _FFClick _FFFormSubmit _FFLoadWait _FFDisPatchEvent _FFOpenURL _FFTabAdd _FFTabClose _FFTabSetSelected now updating the FFau3.WCD-object (window.content.document) - Fixed: Different problems after _FFTabAdd - Fixed: Different problems after _FFOpenURL - Fixed: Error in _FFAu3Option() V0.6.0.1b-4 - Changed: Default values for _FFXpath: _FFXPath($sQuery, $sAttribute = "", $iReturnType = 9, $iFilter = 0) - Fixed: Different problems after _FFTabAdd - Fixed: Different problems after _FFOpenURL - Fixed: Errorin _FFAu3Option() V0.6.0.1 - Added: Option $_FF_SEARCH_MODE works now for: _FFLinkClick _FFImageClick - Added: _FFClick: Parameter $bLoadWait - Added: _FFLoadWait: Parameter $bStop = stops pageloading after timeout - Added: _FFAu3Option: "LoadWaitStop" - Added: Global var $_FF_LOADWAIT_STOP - Updated: _FFXPath: some optimizations (shorter command strings to send) - Optimized: _FFFormOptionSelect - Optimized: _FFLoadWait - Fixed: _FFGetPosition: Removed error if "MozillaContentWindowClass" is not found - Fixed: _FFSearch: Error with non-ASCII-chars - Fixed: _FFLinkClick: Error with non-ASCII-chars - Fixed: _FFImageClick: Error with non-ASCII-chars - Fixed: _FFAction("alert", ...): Error with non-ASCII-charsFor compatibily for older scripts and more functions, please use this UDF:http://thorsten-willert.de/Themen/FFau3/FF.au3/FFEx.au3Function list:_FFAction_FFClick_FFCmd_FFConnect_FFDialogWait_FFDisConnect_FFDispatchEvent_FFFormCheckBox_FFFormGetElementsLength_FFFormOptionSelect_FFFormRadioButton_FFFormReset_FFFormSubmit_FFFrameEnter_FFFrameLeave_FFGetLength_FFGetObjectInfo_FFGetPosition_FFGetValue_FFImageClick_FFImageGetBySize_FFImageMapClick_FFIsConnected_FFLinkClick_FFLinksGetAll_FFLoadWait_FFLoadWaitTimeOut_FFObj_FFObjDelete_FFObjGet_FFObjNew_FFOpenURL_FFPrefGet_FFPrefReset_FFPrefSet_FFQuit_FFReadHTML_FFReadText_FFSearch_FFSetValue_FFStart_FFTabAdd_FFTabClose_FFTabDuplicate_FFTabExists_FFTabGetSelected_FFTabSetSelected_FFTableWriteToArray_FFWindowClose_FFWindowGetHandle_FFWindowOpen_FFWindowSelect_FFWriteHTML_FFXPathRequirement(s).:Latest Version of FireFox and the AddOn MozRepl!!!Don't forget to start MozRepl.FF-menu: Extras/Menu or check there "Activate on startup".Documentation:- English- German- Russian (by Valery)- Englisch CHM, user-calltips ...FF.au3 extensions:- _FF_DM.au3 (UDF for the FireFox Download-Manager) [Forum]- _FFEx.au3 (more functions and compatibly fixes for older scripts):; _FFDisPatchKeyEvent; _FFFormGetLength; _FFGetValueById; _FFGetValueByName; _FFSetValueById; _FFSetValueByName; _FFTabCloseAll; _FFTabGetLength; _FFTableGetCell; _FF_Call; _FF_CookiesAllow; _FF_CookiesDeny; _FF_CookiesRemoveAll; _FF_CookiesSetAccess; _FF_EmptyCache; _FF_EmptyCookies / _FF_CookiesRemoveAll; _FF_EmptyHistory; _FF_FormSetFileInput; _FF_GetContentXY; _FF_GetCurrentURL; _FF_GetStatus; _FF_GetTitle; _FF_MozRepl_Detect; _FF_ResetTitle; _FF_TabGetAllTitles; _FF_TabGetAllURLs; _FF_TabReloadAllUDFs for FireFox AddOns:- _FF_FireFM [Forum]- _FF_FoxBox.au3 [Forum]- _FF_Screengrab.au3 [Forum]Misc:- _FF_AutoLogin [Forum]- _FF_RecordForm [Forum]- YouTube-API-Wrapper [Forum]Known problems:- The _FFTab* functions doesn't work, if you have the FF-AddOn TabMixPlus installed (this AddOn seems to override some internal FF-functions)More examples and stuff are on my homepage.Stilgar Edited August 4, 2015 by Melba23 Fixed link pndhcm280-, Pricehacker and justdoit123 2 1 jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Bert Posted May 26, 2009 Share Posted May 26, 2009 I take it for any response on FF.au3, you should post in this thread, not the one I started and Stilgar maintained. Pricehacker 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
bo8ster Posted May 26, 2009 Share Posted May 26, 2009 Great stuff! Is this likely to be in a future release like the IE library is? This has massive potential! Pricehacker 1 Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 26, 2009 Moderators Share Posted May 26, 2009 (edited) I know this method takes a different approach. But Authenticity posted a very nice link to automate FF like IE the other day... http://www.iol.ie/~locka/mozilla/control.htmIf you're interested, or maybe want to expand in areas you may not have with the current setup. Edited May 26, 2009 by SmOke_N ebonics Pricehacker 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Stilgar Posted May 26, 2009 Author Share Posted May 26, 2009 I know this method takes a different approach. But Authenticity posted a very nice link to automate FF like IE the other day... http://www.iol.ie/~locka/mozilla/control.htmIf you're interested, or maybe want to expand in areas you may not have with the current setup.Hello,yes I know about it.But this thing is only working with FF V1.5!http://www.iol.ie/~locka/mozilla/mozilla.htmhttp://kb.mozillazine.org/ActiveXAnd it crashes FF V2.x. We have V3.x now ... The only other thing I found was an"An NPAPI based plugin for Firefox that enables the use of ActiveX controls":http://code.google.com/p/ff-activex-host/but I don't know if this the right thing and it has many limits, because of the security riscs by ActiveX. Pricehacker 1 jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
cypher175 Posted June 1, 2009 Share Posted June 1, 2009 can this UDF to control FireFox be used for embedding FF into a GUI AutoIt Script..?? If not than whats the best way to do it then..?? Pricehacker 1 Link to comment Share on other sites More sharing options...
cypher175 Posted June 1, 2009 Share Posted June 1, 2009 could these FF functions be used to control an embedded FF Mozilla ActiveX control that's mentioned here..??#141301 Pricehacker 1 Link to comment Share on other sites More sharing options...
Stilgar Posted June 1, 2009 Author Share Posted June 1, 2009 could these FF functions be used to control an embedded FF Mozilla ActiveX control that's mentioned here..??#141301Sorry, like I said two posts bevore, this thing is for FF V1.5, it doesn't work with the current versions.And I have no other solution, yet.Only a dirty hack:_FF_CreateEmbedded.au3 Pricehacker 1 jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Elena Posted June 5, 2009 Share Posted June 5, 2009 Thank you for the updated library, I'm using it and I like it. But I'd suggest changing the function __FFIsURL. Look: now all URLs like "localhost" or IP-like (XXX.XXX.XXX.XXX) are rejected by this function, and i can't even open my forst FF window. I'd suggest this one: Func __FFIsURL(ByRef $URL) Return (StringRegExp($URL, '^^((ht|f)tp(s?)\:\/\/|~/|/)([\w]+:\w+@)?([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((/?\w+/)+|/?)(\w+\.[\w]{3,4})?((\?\w+=\w+)?(&\w+=\w+)*)?') Or _ StringRegExp($URL,'^((ht|f)tp(s?)://)?(\d{1,3}\.){3}\d{1,3}(:[\d]{1,5})?(/.*)?$') Or _ StringLeft($URL, 6) = "about:" Or _ StringLeft($URL, 7) = "chrome:" Or _ StringLeft($URL, 10) = "localhost:" Or _ StringLeft($URL, 8) = "file:///") EndFunc ;==>__FFIsURL What do you think? Pricehacker 1 Link to comment Share on other sites More sharing options...
Stilgar Posted June 7, 2009 Author Share Posted June 7, 2009 (edited) @Elena: Thank you for your suggestion, I would use it (or similar) in the next version. Edited June 7, 2009 by Stilgar Pricehacker 1 jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
FinalVersion Posted June 8, 2009 Share Posted June 8, 2009 So is Firefox 3.5 ( The Beta ) or what version is required for MozRepl ? Pricehacker 1 [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Stilgar Posted June 8, 2009 Author Share Posted June 8, 2009 So is Firefox 3.5 ( The Beta ) or what version is required for MozRepl ?MozRepl works from V3.0.x - V3.5.x Pricehacker 1 jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
FinalVersion Posted June 11, 2009 Share Posted June 11, 2009 MozRepl works from V3.0.x - V3.5.x3.0.10 Doesn't... Pricehacker 1 [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Elena Posted June 11, 2009 Share Posted June 11, 2009 Hi Stilgar, Do you support "frame in frame" handling? Please help me with automation of my page. Unfortunately I cannot get a link to it as it is in our network with VPN, but I'll describe it. The page contains of different set of frames with "frame in frame" architecture: Frame "Main" is located in browser page; Frame "DataEntry" is located in frame "Main"; Form "form1" is located in frame "DataEntry"; Drop-down "PID" and text edit box "sfname" are located in form "form1". My code is: $FFInstance = _FFStart($g_sDataEntryLink) $mainFrame = _FFFrameEnter("Main", "name") $mainFrame = _FFFrameGetSelected("name") MsgBox(0, "$mainFrame", $mainFrame) $DataEntryFrame = _FFFrameEnter("DataEntry", "name") $mainFrame = _FFFrameGetSelected("name") MsgBox(0, "$DataEntryFrame", $DataEntryFrame) Sleep (5000) _FFFormOptionselect("PID", "name", "Custom HF Request", "name", "form1", "name") $First_name = _FFGetValueByName("sfname", 3,0) MsgBox(0, "$First_name", $First_name) My script opens a page, then gives message box with "Main" (so it determines the first frame correctly). Second message box returns "-1", third one returns empty string (though I fill the sfname textbox while sleeping). "Custom HF Request" option is not set in a dropdown. What I do wrongly? Thanks in advance. Pricehacker 1 Link to comment Share on other sites More sharing options...
Stilgar Posted June 14, 2009 Author Share Posted June 14, 2009 @Elena sorry currently not. Known problems: - The _FFTab* functions doesn't work, if you have the FF-AddOn TabMixPlus installed (this AddOn seems to override some internal FF-functions) - Nested frames are not supported by the _FFFrame* functions yet, but you have access to them over DOM. Access over DOM is a bit complicated in this case. But you can load only the "inner" frame-set: _FFFrameEnter('Main','name') $url = _FFCmd('.location.href') _FFFrameLeave() _FFOpenURL($url) _FFFrameEnter("DataEntry", "name") $mainFrame = _FFFrameGetSelected("name") MsgBox(0, "$DataEntryFrame", $DataEntryFrame) ... jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
cypher175 Posted June 15, 2009 Share Posted June 15, 2009 is anyone working/developing on embedding FF into a AutoIt GUI at all yet..?? Link to comment Share on other sites More sharing options...
Elena Posted June 16, 2009 Share Posted June 16, 2009 Hi Stilgar, Thank you for your comment about nested frames, I can use it now! I noticed a mistake in my - and, also yours, - code. Tried this (changed $mainFrame to $DataEntryFrame): _FFFrameEnter('Main','name') $url = _FFCmd('.location.href') _FFFrameLeave() _FFOpenURL($url) _FFFrameEnter("DataEntry", "name") $DataEntryFrame = _FFFrameGetSelected("name") MsgBox(0, "$DataEntryFrame", $DataEntryFrame) It works! Are you working on nested frames handling for next FF.au3 versions? I worked with IE library and wrote a recursive function which searches named frames in chain of frames in a page. I will try to realize it for FF. Do you have some function now which returns a set of frames, like _IEFrameGetCollection? Link to comment Share on other sites More sharing options...
Stilgar Posted June 17, 2009 Author Share Posted June 17, 2009 @Elena: Hi, no collections, but you just can use _FFGetLength("frames") and the frame-index in a loop, or you use: $aNames = _FFXpath("//frame","name",6) $aNames = _FFXpath("//iframe","name",6) ; for iframes that returns an array with the name of all frames. jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
goldenix Posted June 19, 2009 Share Posted June 19, 2009 Hire is some feedback: I have many tabs open + many addons installed including tabmix. Im looking for a way to do _ie_navigate() / with firefox. I have this: 1 active tab & i need to change the url constantly: www...pool/show/001 www...pool/show/002 www...pool/show/003 etc... I installed the addon & tried the _FFOpenURL sample. but it said cant connect to firefox. & nothing happened. Is there a way to do this? My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list] Link to comment Share on other sites More sharing options...
Stilgar Posted June 19, 2009 Author Share Posted June 19, 2009 I installed the addon & tried the _FFOpenURL sample. but it said cant connect to firefox. & nothing happened.Hello,have you started MozRepl?FF-menu: Extras/MozRepl jEdit4AutoIt PlanMaker_UDF 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