I will attempt to help.
This might be at least part of what you are looking for.
You seem to be asking about an action to occur in response to a firefox browser opening a web page; "is executed when a specific website is opened by an firefox browser." That can be complicated, or not.
If you can, then subclass firefox and detect each time that firefox starts to open a new web page. Get the temporary handle (which is not called a handle and I do not recall exactly what it is called) that is created before firefox incorporates that temporary handle into it's overall one (single, no others allowed) handle, and then create an actual handle for that temporary handle and work with that new handle.
You might find it useful to study the following pages about subclassing carefully:
And this is a little different, but it might help if you study it also:
https://pythonexamples.org/python-op...refox-browser/