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
642 replies to this topic

#1 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 25 May 2009 - 03:36 PM

UDF to control FireFox via MozRepl:

FF.au3 (V0.6.0.1b-10)
Changelog

Changes 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-chars

For compatibily for older scripts and more functions, please use this UDF:
http://thorsten-willert.de/Themen/FFau3/FF.au3/FFEx.au3

Function 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
_FFXPath

Requirement(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_TabReloadAll


UDFs 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 by Stilgar, 01 January 2014 - 10:40 AM.

  • justdoit123 likes this







#2 DarthCookieMonster

DarthCookieMonster

    I ate your mom's cookie. Nom Nom Nom...

  • MVPs
  • 11,928 posts

Posted 26 May 2009 - 01:13 AM

I take it for any response on FF.au3, you should post in this thread, not the one I started and Stilgar maintained.

The Vollatran project
_____


msg-108-0-96549500-1409901790.png
Obi didn't believe me when I told him the dark side has milk and cookies....


#3 bo8ster

bo8ster

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,189 posts

Posted 26 May 2009 - 02:25 AM

Great stuff! Is this likely to be in a future release like the IE library is?
This has massive potential!
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)Brett F's Learning To Script with AutoIt V3Valuater's AutoIt 1-2-3, Class... is now in SessionContribution: Get SVN Rev Number, Control Handle under mouse, A Presentation using AutoIt, Log ConsoleWrite output in Scite

#4 SmOke_N

SmOke_N

    It's not what you know ... It's what you can prove!

  • Moderators
  • 15,730 posts

Posted 26 May 2009 - 05:05 AM

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.htm
If you're interested, or maybe want to expand in areas you may not have with the current setup.

Edited by SmOke_N, 26 May 2009 - 05:09 AM.
ebonics

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.


#5 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 26 May 2009 - 06:44 AM

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.htm
If 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.htm
http://kb.mozillazine.org/ActiveX

And 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.

#6 cypher175

cypher175

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 482 posts

Posted 01 June 2009 - 12:00 PM

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..??

#7 cypher175

cypher175

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 482 posts

Posted 01 June 2009 - 08:18 PM

could these FF functions be used to control an embedded FF Mozilla ActiveX control that's mentioned here..??
http://www.autoitscript.com/forum/index.ph...st&p=141301

#8 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 01 June 2009 - 08:36 PM

could these FF functions be used to control an embedded FF Mozilla ActiveX control that's mentioned here..??
http://www.autoitscript.com/forum/index.ph...st&p=141301


Sorry, 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

#9 Elena

Elena

    Seeker

  • Active Members
  • 7 posts

Posted 05 June 2009 - 02:39 PM

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?

#10 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 07 June 2009 - 03:23 PM

@Elena:
Thank you for your suggestion, I would use it (or similar) in the next version.

Edited by Stilgar, 07 June 2009 - 03:24 PM.


#11 FinalVersion

FinalVersion

    0 ^ 1

  • Active Members
  • PipPipPipPipPipPip
  • 599 posts

Posted 08 June 2009 - 02:50 AM

So is Firefox 3.5 ( The Beta ) or what version is required for MozRepl ?

#12 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 08 June 2009 - 07:30 AM

So is Firefox 3.5 ( The Beta ) or what version is required for MozRepl ?

MozRepl works from V3.0.x - V3.5.x

#13 FinalVersion

FinalVersion

    0 ^ 1

  • Active Members
  • PipPipPipPipPipPip
  • 599 posts

Posted 11 June 2009 - 01:24 AM

MozRepl works from V3.0.x - V3.5.x

3.0.10 Doesn't...

#14 Elena

Elena

    Seeker

  • Active Members
  • 7 posts

Posted 11 June 2009 - 08:23 AM

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.

#15 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 14 June 2009 - 09:19 AM

@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) ...


#16 cypher175

cypher175

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 482 posts

Posted 15 June 2009 - 05:35 AM

is anyone working/developing on embedding FF into a AutoIt GUI at all yet..??

#17 Elena

Elena

    Seeker

  • Active Members
  • 7 posts

Posted 16 June 2009 - 09:31 AM

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?

#18 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 17 June 2009 - 04:30 PM

@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.

#19 goldenix

goldenix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 738 posts

Posted 19 June 2009 - 09:19 PM

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?

#20 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 19 June 2009 - 09:25 PM

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




4 user(s) are reading this topic

1 members, 3 guests, 0 anonymous users


    david678