Unable to close Firefox

Discussions and Tech Support related to the iMacros Firefox Add-on, including the built-in Javascript scripting interface for playing .js files.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

Unable to close Firefox

by engeeaitch on Sun Aug 14, 2016 9:09 am

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?
engeeaitch
 
Posts: 1
Joined: Sun Aug 14, 2016 8:54 am

Re: Unable to close Firefox

by Tom, Tech Support on Mon Aug 15, 2016 7:07 am

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
Tom, Tech Support
 
Posts: 3298
Joined: Mon May 31, 2010 9:59 am

Re: Unable to close Firefox

by iimfun on Mon Aug 15, 2016 8:12 am

Alternatively you can try the following code
Code: Select all
'TAB T=1
'TAB CLOSEALLOTHERS
EVENT TYPE=KEYPRESS SELECTOR=* CHAR="w" MODIFIERS="ctrl,shift"
iimfun
 
Posts: 238
Joined: Tue Jul 19, 2016 6:06 am

Re: Unable to close Firefox

by Tom, Tech Support on Mon Aug 15, 2016 8:22 am

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
Tom, Tech Support
 
Posts: 3298
Joined: Mon May 31, 2010 9:59 am

Re: Unable to close Firefox

by qb1kenobi on Fri Feb 03, 2017 6:43 pm

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..
qb1kenobi
 
Posts: 3
Joined: Fri Feb 03, 2017 6:27 pm

Re: Unable to close Firefox

by chivracq on Fri Feb 03, 2017 8:43 pm

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6472
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Unable to close Firefox

by qb1kenobi on Fri Feb 03, 2017 11:29 pm

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.
qb1kenobi
 
Posts: 3
Joined: Fri Feb 03, 2017 6:27 pm

Re: Unable to close Firefox

by chivracq on Sat Feb 04, 2017 7:54 am

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)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6472
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Unable to close Firefox

by qb1kenobi on Sat Feb 04, 2017 3: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
qb1kenobi
 
Posts: 3
Joined: Fri Feb 03, 2017 6:27 pm


Return to iMacros for Firefox

Who is online

Users browsing this forum: No registered users and 7 guests

-->