Jump to content
Sign in to follow this  
Clerythecleric

Catching firefox events? Possible?

Recommended Posts

Clerythecleric

Hello,

 

I don't even know if this is possible,  I found this code (adapted it for FF) which is supposed to give an output to be used with TLBViewer.au3 to determine which events are fired off to see if I can catch them. The code doesn't do anything but is this even possible to do? Maybe there is another function i'm not aware of or an alternative?

Basically I'm trying to see if its possible to see when a certain button is pressed on a webpage via firefox and to then update some numbers based off that.
 

Please and thank you!

Regards

Ant

 

#include <FF.au3>

Local $oIE = _FFConnect(Default, default, 3000)

Local $oButton = _FFXpath("/html/body/form/section[1]/button[1]", "id")
MsgBox("", "", $oButton)

ConsoleWrite(ObjName($oButton) & @CRLF)
ConsoleWrite(ObjName($oButton, 4) & @CRLF) ; File with Interface defs
ConsoleWrite(ObjName($oButton, 6) & @CRLF) ; CLSID of the object's coclass

; Event object
Local $oEvent = ObjEvent($oButton, "_MY_EVENT_HANDLER_")

Sleep(10000)



Func _MY_EVENT_HANDLER_onclick($oEvtObj)
    ConsoleWrite("!!!!!CLICKED THE BUTTON" & @CRLF)
    MsgBox(4096, "Yay JohnOne!", "You clicked the button.")
EndFunc

 

Share this post


Link to post
Share on other sites
Jury
Posted (edited)

If you are using a recent version of FireFox (after ver. 54) then the necessary add_on  MozRepl (which is necessary for FF.au3 to work) no longer works.  You may want to look at:

 

 

Edited by Jury
correction

Share this post


Link to post
Share on other sites
Clerythecleric

Oh awesome, I'm doing this at work n everything works fine so i guess there using an older one. But that WebDriver looks interesting, i'll take a look into that thanks.
out of interest, while i'm here. Will that work with firefox 'Quantum' as well?

Thanks Again
Clery

Share this post


Link to post
Share on other sites
Danp2
2 hours ago, Clerythecleric said:

Will that work with firefox 'Quantum'

Yes, and most other current browsers as well.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×