Not able to close Firefox Properly in Mac

Discussions and Tech Support specific to the iMacros Firefox add-on.
Forum rules
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
Nihark
Posts: 6
Joined: Thu Dec 20, 2018 6:37 pm

Not able to close Firefox Properly in Mac

Post by Nihark » Fri Nov 08, 2019 3:48 pm

Hello,

I am not able to close firefox cleanly in Mac. I am able to do it on a windows machine. I have searched through the forum and not able to find something thats working for me. Please help.

Things I have tried -

1.
TAB CLOSEALLOTHERS
TAB CLOSE

This closes the current window but doesnt end the firefox process running in the background.

2.
Command +Q closes Firefox properly in mac. But After trying in the recording mode in imacros, i think command key is not recognized properly in imacros.
So, as an alternative, created a custom shortcut key combination of alt + Enter by visiting "System Preferences" in mac. This combination is working if I press the keys manually, but not working in the code.

EVENT TYPE=KEYPRESS SELECTOR=* KEY=13 MODIFIERS="alt"

I am using legacy version of imacros 8.9.7 and an older version of firefox 56.0.
I am stuck.. Kindly help.. Thanks!
chivracq
Posts: 9311
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Not able to close Firefox Properly in Mac

Post by chivracq » Fri Nov 08, 2019 5:13 pm

Nihark wrote:
Fri Nov 08, 2019 3:48 pm
Hello,

I am not able to close firefox cleanly in Mac. I am able to do it on a windows machine. I have searched through the forum and not able to find something thats working for me. Please help.

Things I have tried -

1.

Code: Select all

TAB CLOSEALLOTHERS
TAB CLOSE
This closes the current window but doesnt end the firefox process running in the background.

2.
Command +Q closes Firefox properly in mac. But After trying in the recording mode in imacros, i think command key is not recognized properly in imacros.
So, as an alternative, created a custom shortcut key combination of alt + Enter by visiting "System Preferences" in mac. This combination is working if I press the keys manually, but not working in the code.

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* KEY=13 MODIFIERS="alt"
I am using legacy version of imacros 8.9.7 and an older version of firefox 56.0.
I am stuck.. Kindly help.. Thanks!

Hum, good, you've finally followed up on your previous Thread, after nearly 1 year, would have been my first "Condition" to help you in this one..., and I "hope" you'll follow up "a bit quicker" in this one, I usually don't react/help anymore if there is no Follow-up... :idea:

>>>

Would help if you could mention your FCI a bit (more) clearly, and not scattered in some Text + Thread Title, preferably at the complete beginning of your Post when you open a new Thread (or post (for the 1st time) in some existing Thread), this is the first bit of Info I look for to decide if I'll read the Post...

=> FCI:

Code: Select all

iMacros for FF v8.9.7, FF v56.0, MacOS
"Recommend" FF Version on v8.9.7 for FF would btw be FF v55.0.3 rather than FF v56.0 which was the last Version to work with v8.9.7 for FF. :idea:
A few "Things" (Commands and Functionalities) got broken and not working "properly" in FF56, compared to FF55.

>>>

Okay..., concerning your Qt, yep, your first Attempt with 'TAB CLOSEALLOTHERS' + 'TAB CLOSE' should "do the Trick" indeed, but had many times been reported to not always close FF completely and reliably...

Your second Attempt with 'Command^Q' using the 'EVENT' Mode (Code not posted) should work, I would expect..., if that 'Command^Q' works manually in FF for MacOS... (I'm not very familiar with MacOS...)

Your third Attempt with 'Alt^Enter' using the 'EVENT' Mode will indeed not work as this Shortcut is defined at the OS Level, and only Shortcut defined/relayed at the Browser Level will work with the 'EVENT' Mode... (This Behaviour is documented in the Wiki...)

On Win32/64, you also have 'Alt^F4' (doesn't work) and 'Ctrl^w' (works) to also close a FF Instance. (But maybe 'Ctrl^w' is the "Equivalent" to your 'Command^Q'...(?))

Have a look at the following Thread where I once did a bit of Testing about that Functionality and also referenced all "relevant" Threads on the Forum, and you'll find my "Item_4" somewhere with another way to close FF, or at least the last Tab after a 'TAB CLOSEALLOTHERS' which might be more "powerful" than your 'TAB CLOSE'... (... and has never been tested on MacOS, so I would be interested to hear about your Results anyway...):
- Re: How to close the iMacros Browser?
(Ouf...!, was already from 5 years ago, ah-ah...!)

And hum, you'll have to test in FF56, but the 'URL GOTO=javascript' Syntax I used is exactly one of the Funcs that were not working "correctly" anymore in FF56, I think, ah-ah...!, so you might have to switch/test also on FF v55.0.3.
I just tested on v8.9.7 for FF + FF v55.0.3 + Win10_x64, and it (still) works! 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 9311
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Not able to close Firefox Properly in Mac

Post by chivracq » Fri Nov 08, 2019 11:45 pm

Oh...?, hum... OK, nearly surprised 6h later, after coming back from "my Evening" and not to see any Follow-up, hum..., OK... :(

But OK, I hope @OP that you'll follow up on this "a huge bit better" than on your previous Thread... :idea:
You were "lucky" you updated your previous Thread before I noticed and reacted to this one, or my "Standard Rate" is "update/follow up/finish your previous Thread "correctly" before I will ueberhaupt react to this current one, then bump your Thread again in [xx] weeks/months if you are still looking for a Sol by that time"...
And "[xx]" = same Amount of Time, I had to wait for the Follow-up... :|

You still have 18h to react @OP :!: , or the 11-Month "Waiting Time" will then be applied... :P (or for your next Thread, as I would think that my previous Reply will probably have provided at least one Solution for your Qt in this current Thread..., so I actually wouldn't be "surprised" indeed if you won't react anymore - fair enough...), ... until you have a "next Pb", but/then sorry, don't be "surprised" if I don't try to help you anymore then... :shock: .
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Nihark
Posts: 6
Joined: Thu Dec 20, 2018 6:37 pm

Re: Not able to close Firefox Properly in Mac

Post by Nihark » Sat Nov 09, 2019 1:58 am

Hey Sorry, I Was about to reply.. It was night here, so was sleeping for the last 7 hours... Just woke up and was testing your suggestions.

Thank you so much for the effort you have put in !

I switched to FF v55.0.3 as mentioned by you.

Tried your method 4 -

Code: Select all

URL GOTO=javascript:this.focus();self.opener=this;self.close()
This was not working initially. Changed the flag in about:config, dom.allow_scripts_to_close_windows to TRUE and then it is working. But it is again closing the current window but not quitting firefox entirely.

I just wish there was a modifier for "Command" key in Mac :)
chivracq
Posts: 9311
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Not able to close Firefox Properly in Mac

Post by chivracq » Sat Nov 09, 2019 4:04 am

Nihark wrote:
Sat Nov 09, 2019 1:58 am
Hey Sorry, I Was about to reply.. It was night here, so was sleeping for the last 7 hours... Just woke up and was testing your suggestions.

Thank you so much for the effort you have put in !

I switched to FF v55.0.3 as mentioned by you.

Tried your method 4 -

Code: Select all

URL GOTO=javascript:this.focus();self.opener=this;self.close()
This was not working initially. Changed the flag in about:config, dom.allow_scripts_to_close_windows to TRUE and then it is working. But it is again closing the current window but not quitting firefox entirely.

I just wish there was a modifier for "Command" key in Mac :)

Ah-ah...!, of course you are "allowed" to sleep, re-ah-ah...! But not too long...! :wink:

Oh, but you should first have tested in FF56 before moving to FF55..., even if it was just to confirm that 'URL GOTO=javascript' doesn't "really" work in FF56 and that you would notice some "clear" Difference between the 2 FF Versions..., but OK, no Big-Deal..., I could do the Testing myself if I really want to know the Answer... :wink:

And yep, of course about 'about:config, dom.allow_scripts_to_close_windows', I've mentioned it several times indeed, and I thought in "that" Thread also already, even if it's from 5 years ago, but OK, I'll have to check...

About "closing the current window but not quitting firefox entirely", do you then have several Instances of the FF Browser running/opened at that moment...?
I would expect if the Browser Instance you are closing at any moment is the only/last Instance, that the whole Browser would/should close also, a bit like the Syntax from "my Item_4" which is indeed the Syntax you've posted, actually "only" closes 1 Tab, but if that Tab is the last one, it will close the FF Instance, and if that FF Instance was the last and only one, it will completely kill the Process. (At least on Win32/64, this is how "it works"...)

About your "I just wish there was a modifier for "Command" key in Mac :)"
=> Yep there is, (=> 'META'), but you didn't post any Script about what you tried...!? :?
Nobody has ever reported that 'META' Argument not to work, so hum-hum...?
But re-hum-hum..., that Documentation about the 'META' Arg only came after v10.0.5 for CR, so hum-hum indeed, it could be indeed that it was never supported (yet) in v8.9.7 for FF.
(The Wiki about the 'EVENT' Mode/Command is "now" a bit fucked up :roll: , FF is not even mentioned as supporting that Command anymore, because v10.0.2 for FF indeed doesn't support the 'EVENT' anymore, so it's difficult to know now which specific Func is/was supported/supposed to work in any specific Version...)

(And as I don't use a MacOS Env., at least a bit "Standard" and regularly, and even less with "Advanced"/OS-Specific Funcs, I never really tested anything "specific" on that OS...)

But hum.., I would/might have a few other Workarounds for you, ah-ah...!
But pfff, a bit late for me now, I'm the one who needs some Sleep now, ah-ah...! :wink:
(I'm a DJ IRL, long Day tomorrow for me and playing for some Festival, probably "back" on the Forum on Sunday, I guess...)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Nihark
Posts: 6
Joined: Thu Dec 20, 2018 6:37 pm

Re: Not able to close Firefox Properly in Mac

Post by Nihark » Sat Nov 09, 2019 10:03 am

Oh, but you should first have tested in FF56 before moving to FF55
Checked it now :D ... Its the same behaviour in both versions of FF
About "closing the current window but not quitting firefox entirely", do you then have several Instances of the FF Browser running/opened at that moment...?
I am testing with only one instance and one tab of firefox.
In Mac, even if you manually press the Cross button at the top, then also , it closes only the current window of Firefox and keeps the firefox process alive in the background.
About your "I just wish there was a modifier for "Command" key in Mac :)"
=> Yep there is, (=> 'META'), but you didn't post any Script about what you tried...!? :?
Command + Q kills the firefox properly. I tried using the code -

Code: Select all

EVENT TYPE=KEYPRESS SELECTOR=* CHAR="q" MODIFIERS="meta"
This is not working ...

Basically what I am trying to do is automate a task multiple times. Each time the task begins, it begins by starting firefox and running the macro. And in Mac, two separate instances of Firefox are not allowed. So if it is not closed properly the first time, it wont work the second time.

For now I have found a temporary solution to the problem using "Automator" in Mac. From there I am able to kill the firefox instance before starting the script second time.

But would definitely want to know the right way through imacros.

Thanks again ! Enjoy your weekend...!
Post Reply