I am trying to monitor a TAB in Firefox and detect when the TAB has a web app running and when the TAB closes, indicating the web app needs to be closed.
I have a bash script that is able to detect a web app and all its pages running in the Firefox TAB, but the script does not detect when the tab is closed
OR
I have a script that detects a web app TAB is closed , but this script only detects a specific web page of the web app is running, that being the active page in the tab
I have been trying to get both working together, zilch, I must be approaching this wrong, does anyone know how to do this ???
Thanks,
Anne
PS I even asked AI for help , and , well, it gave me all sorts of non usable stuff !
Are you using the firefox extension called BroTab ?
If so , you need to also install a Python program called brotab
Then you should be able to use brotab commands like brotab list
or brotab activate <tabid>
xdotool is X11 only.
It is quite low-level and I have not used it.
Will have a look , but it may take some time.
Oh. You are wise not to use it then.
I wonder could we get a clue by looking at he source code of brotab.
It might be a difficult read, but there must be some function in there that accesses the state of a tab
There may be info here
Apparently there are files that firefox saves , at least for open tabs…but what is there depends on whether firefox is running
"The kinds of files you may find among your sessionstore files are:
recovery.js: the windows and tabs in your currently live Firefox session (or, if Firefox crashed at the last shutdown and is still closed, your last session)
recovery.bak: a backup copy of recovery.js
previous.js: the windows and tabs in your last Firefox session
upgrade.js-build_id: the windows and tabs in the Firefox session that was live at the time of your last update
"
This will list all tabs
Ctll+Shift+T will pull one closed tab… use repeatedly to get a list
Thanks for the suggestions as they got me started in another approach AND success !!! I now have a python script that checks for the tab on execution and waits for a expected tab to open and if it does not within a time frame, exits….. however if the tab is detected during the start up, the code switches to monitor mode and then (loops), waits for it to go away and when the tab goes away the routine exits… Perfect, as I said… thanks for the suggestions, a new approach was needed.