Typically...
- SendInput ^w would close a Firefox tab
- SendInput ^{F4} works with fewer hiccups
When this happens the keystrokes will be dropped indefinitely if the window remains active in its current state. To make the window responsive to the keyboard, the active window either has to be changed (and changed back, i.e., go to a different program and come back), or the content area of the active tab has to be clicked on and then the keystrokes will start working. Most of the time.
Wondering if anyone has any ideas for programmatically closing a Firefox tab. I could still use a keystroke for something else, so long as it triggers the tab to close 100% of the time... for example loading another Firefox extension would be fine, even if its only function was to help close the active tab. I found one that adds another button (somewhere else of your choosing on the Firefox GUI), but it doesn't support a shortcut key as far as I can tell. Also, moving the mouse probably won't work for what I need to do, so a Control-Click would work for example if I could get a control reference that would work like that, but moving the mouse to click on a set of X/Y coordinates would not.
I also found this post to get the active browser URL, but not sure if an adaptation of some of that code could possibly work or not.
Trying to come up with ideas for a way that might make an automated close happen a little more reliably besides the keystrokes that are randomly not working now.
I also haven't had much luck distinguishing between native tabs and ieTabs, although there are two possible methods that come to mind for possibly determining that information... that would be possibly helpful if there is a special function to close just the ieTab (without the requirement for that function to work on native tabs). That would still require figuring out how to close the ieTab though, even if I could detect that it was an ieTab.