Unable to close Firefox

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
engeeaitch
Posts: 4
Joined: Sun Aug 14, 2016 3:54 pm

Unable to close Firefox

Post by engeeaitch » Sun Aug 14, 2016 4:09 pm

I am using version 9.0.3 of iMacros with version 48.0 of Firefox running on Windows 10 64bit, with Multiprocess Windows disabled.

I am trying to start Firefox from a batch file, execute a macro and then close Firefox.

My batch file looks like this:
start "" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" imacros://run/?m=Test.js

Test.js calls a macro that looks like this:
TAB T=1
TAB CLOSEALLOTHERS
TAB CLOSE

When I run Test.js from within Firefox, all is OK. However, when I run the batch file, Firefox closes, but there is then a background Firefox process left running, which eventually crashes after about 60 seconds. If I try to start Firefox during this period, it says Firefox is already running, but not responding.

I have temporarily overcome this problem by downgrading to version 8.9.7 and using windows.close(); in Test.js but no doubt one day, I will be forced to upgrade.

Any ideas please?
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Unable to close Firefox

Post by Tom, Tech Support » Mon Aug 15, 2016 2:07 pm

Hi engeeaitch,

Thanks for the report, I have logged this for further investigation by the development team.

Please note that this issue is not specific to 9.0.3, the same behavior occurs when testing with iMacros 8.9.7 and Firefox 47.

I'd also like to point out that using the iMacros Enterprise scripting interface you can also launch macros from the command line/batch/scheduled task and use iimClose to easily close the browser.
Regards,

Tom, iMacros Support
iimfun
Posts: 239
Joined: Tue Jul 19, 2016 1:06 pm

Re: Unable to close Firefox

Post by iimfun » Mon Aug 15, 2016 3:12 pm

Alternatively you can try the following code

Code: Select all

'TAB T=1
'TAB CLOSEALLOTHERS
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="w" MODIFIERS="ctrl,shift"
Tom, Tech Support
Posts: 3834
Joined: Mon May 31, 2010 4:59 pm

Re: Unable to close Firefox

Post by Tom, Tech Support » Mon Aug 15, 2016 3:22 pm

Hi iimfun,

Thanks for the alternate approach to closing the browser using the EVENT macro command! Indeed that works, but when called from a .js script on the command line it still results in a browser crash.
Regards,

Tom, iMacros Support
qb1kenobi
Posts: 3
Joined: Sat Feb 04, 2017 1:27 am

Re: Unable to close Firefox

Post by qb1kenobi » Sat Feb 04, 2017 1:43 am

Hey guys i recently switched mu installation to a Viortual machine and now Firefox will not close
I use

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* CHAR="w" MODIFIERS="ctrl,shift"
This worked for months on my real computer but now it wont work on the Windows 7 virtual computer, when i press the keys manually it works fine.
Any ideas..
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to close Firefox

Post by chivracq » Sat Feb 04, 2017 3:43 am

qb1kenobi wrote:Hey guys i recently switched mu installation to a Viortual machine and now Firefox will not close
I use

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* CHAR="w" MODIFIERS="ctrl,shift"
This worked for months on my real computer but now it wont work on the Windows 7 virtual computer, when i press the keys manually it works fine.
Any ideas..
FCIM...! :mrgreen:
=> iMacros for FF v...?, FF v...?, Win7.

But hum, this 'Ctrl^Shift^w' is a "Killer" indeed, I didn't now it, works fine manually on FF v51 and PM v26.3.3, I only knew 'Alt^F4' (which works as well manually for both Browsers...).

'Alt^F4' doesn't work from iMacros (... for FF, v8.8.2 till v8.9.7) with the 'EVENT' Mode (well, at least last time I tested...), but I've already posted another Method to close any TAB, and the Browser Instance eventually (only tested on FF/PM)... And there are as well a few other Threads about the same Topic on the Forum, all claiming to have the best way to close the Browser...

I have things to say, but pfff..., after FCI has been mentioned...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
qb1kenobi
Posts: 3
Joined: Sat Feb 04, 2017 1:27 am

Re: Unable to close Firefox

Post by qb1kenobi » Sat Feb 04, 2017 6:29 am

Thanks for reading this even though i made a noob mistake... I know better even though im new here.
Firefox version 51.0.1 32bit
imacros for Firefox 9.0.3 version
Win 7 pro sp1 64bit
Thanks for any help, seems like that alt f4 causes crashes . Whats your best way to perform a clean close?
looking at other posts, the other methods all seem very outdated 2008 2012
the most recent methods seem to use the code im using. what am i missing this function seems like it must be used a lot.
found

Code: Select all

EVENT TYPE=KEYPRESS KEY=115 MODIFIERS="alt"
not working either.
Im running Hyper v Version: 10.0.14393.0 if this matters

**** UPDATE: I installed Pale moon 27.0.3 (x86) with Imacros 8.8.7 seems to work with my script and close the browser after operations are completed.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Unable to close Firefox

Post by chivracq » Sat Feb 04, 2017 2:54 pm

qb1kenobi wrote:Thanks for reading this even though i made a noob mistake... I know better even though im new here.

Code: Select all

Firefox version 51.0.1 32bit
imacros for Firefox 9.0.3 version
Win 7 pro sp1 64bit
Thanks for any help, seems like that alt f4 causes crashes . Whats your best way to perform a clean close?
looking at other posts, the other methods all seem very outdated 2008 2012
the most recent methods seem to use the code im using. what am i missing this function seems like it must be used a lot.

found

Code: Select all

EVENT TYPE=KEYPRESS KEY=115 MODIFIERS="alt"
not working either.

Im running

Code: Select all

Hyper v Version: 10.0.14393.0
if this matters

**** UPDATE: I installed Pale moon 27.0.3 (x86) with Imacros 8.8.7 seems to work with my script and close the browser after operations are completed.
Yep, always mention your FCI when you open a Thread or post for the first time in some existing Thread, I normally don't even read the Qt and certainly don't answer if that Required Info is missing...

So..., OK, you are on v9.0.3 for FF + FF51.
Hum, "my" Solution I was referring to might not work then on this Version as it uses the 'URL GOTO=javascript:' Syntax which has been "tightened" in v9.0.3 and many Workarounds using this Syntax that were working on previous (v8.8.x / v8.9.x) Versions have been reported not to work anymore with v9.0.3.

I'm surprised you didn't find it as I think the

Code: Select all

EVENT TYPE=KEYPRESS KEY=115 MODIFIERS="alt"
is from me as well, and from the same Post, ah-ah...!:
- Re: How to close the iMacros Browser?
chivracq wrote:-4- Now the fourth thought, which proved to be successful, is simply to use!:

Code: Select all

URL GOTO=javascript:this.focus();self.opener=this;self.close()
If several Tabs are open, only the current Tab is closed, you may need to loop/repeat that Statement a few times if you want to make sure to close the Last Tab (and the Window with it) if you have several Tabs open...
Tested on iMacros v8.8.2 for FF on Pale Moon v24.5.0 (=FF29) on WinXP SP3.
In that Thread (originally from 2014, but I updated it later), I refer as well to 2 other interesting/relevant Threads where for example Advanced User @skippyto had posted another "best Method", ah-ah...!

I would btw be interested if you could test that "my" Method still works on your both FCI's, v9.0.3 + FF51 and v8.8.7 + PM27, and as well if by any chance you have some other "Flavours" of iMacros installed on your VM, on IE/iMB and CR for example (with FCI mentioned).
That could still be a Workaround for v9.0.3, if it still works of course...!, and it's always good to have several Ways/Workarounds as some regularly get broken by some newer Version of iMacros of FF or any Browser...
And at that time when I had found it (2014), the 'EVENT' Mode was only available for FF, it only fairly recently (about 1 year ago now maybe...) got implemented in iMacros for CR (v8.4.4.) and IE (v11 or v11.5) and iMB (v11 or v11.5).

Oh yeah...!, and what I wanted to mention from my "I have things to say, but pfff..., after FCI has been mentioned..." is that the 'EVENT' Mode has been reported to have "Difficulties" when the FF Instance it is running in is Minimized or Out of Focus, and as well even if Maximized and In Focus but running on a VM. There was some very recent Thread about that on the SOF (Stackoverflow) Forum but I didn't react as the Quality of the Thread was pretty "low" and I don't have any VM installed anyway (yet) to do any Testing...
(When I say "has been reported...", it means that I didn't encounter the Pb myself and/or didn't test it myself...)

And good that you mentioned which VM Software/Version you are using, as I notice a clear Increase of Users using VM's with iMacros, and which VM Software/Version might play a Role indeed...
But it might be interesting if you could check again if your 'Ctrl^Shift^w' Solution with the 'EVENT' Mode is not dependent maybe on the Minimized/Maximized + In/Out of Focus "Parameters"...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
qb1kenobi
Posts: 3
Joined: Sat Feb 04, 2017 1:27 am

Re: Unable to close Firefox

Post by qb1kenobi » Sat Feb 04, 2017 10:19 pm

yes i treid the

Code: Select all

URL GOTO=javascript:this.focus();self.opener=this;self.close()
this is also not working on the vm
I did try keeping the window in focus and full screen or vice versa out of focus and not full screen, this seems to have no effect on the browser closing

I will test "your" code on the Palemoon browser and give you an update****

I dont know what these are """on IE/iMB and CR """ but i will glady install and test them for ya, i understand internet explorer, thats it....

thanks
Post Reply