Any way of writing a macro that closes the entire browser?

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.

Any way of writing a macro that closes the entire browser?

by vidim on Sat Dec 06, 2014 4:22 am

Any commands that I have overlooked that can close the entire browser?

Basically the same as a CTRL-W keystroke. I know I can close the TAB, but if I can close the entire browser I would save memory and all my concurrently running (about 25) Firefox instances would be less prone to locking up.

Running iMacros Firefox Plugin 8.8.7
Windows 7
Firefox 33.1.1
vidim
 
Posts: 23
Joined: Mon Nov 17, 2014 9:10 am

Re: Any way of writing a macro that closes the entire browse

by vidim on Sat Dec 06, 2014 4:52 am

OP answering his own question:

Yes, easy peasy.

Just use this combination

Code: Select all
TAB CLOSEALLOTHERS
TAB CLOSE


And all of it will be shut down.
Forgive me for posting these questions without thinking through them myself first. It seems like I often manage to fix my own problems after I have put things down in print.

EDIT: And some others claim this leaves Firefox stuck in memory. Guess further testing is needed viewtopic.php?f=11&t=4888#p50315
vidim
 
Posts: 23
Joined: Mon Nov 17, 2014 9:10 am

Re: Any way of writing a macro that closes the entire browse

by chivracq on Sun Dec 07, 2014 2:00 pm

vidim wrote:OP answering his own question:

Yes, easy peasy.

Just use this combination

Code: Select all
TAB CLOSEALLOTHERS
TAB CLOSE


And all of it will be shut down.
Forgive me for posting these questions without thinking through them myself first. It seems like I often manage to fix my own problems after I have put things down in print.

EDIT: And some others claim this leaves Firefox stuck in memory. Guess further testing is needed viewtopic.php?f=11&t=4888#p50315

I once posted what I think is a better Solution...:
- Re: How to close the iMacros Browser?
(See Item '-4-' in that Post...)
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.
Last edited by chivracq on Mon Dec 08, 2014 8:16 am, edited 2 times in total.
- (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: 6479
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Any way of writing a macro that closes the entire browse

by skippyto on Mon Dec 08, 2014 4:14 am

Hi vidim,

If you want to surely close FF, the best way in the following js :

Code: Select all
Components
   .classes['@mozilla.org/toolkit/app-startup;1']
   .getService(Components.interfaces.nsIAppStartup)
   .quit(Components.interfaces.nsIAppStartup.eForceQuit);
// Or use Components.interfaces.nsIAppStartup.eAttemptQuit depending on xhat you really want


Skippyto.
skippyto
 
Posts: 108
Joined: Wed Aug 20, 2008 1:14 am

Re: Any way of writing a macro that closes the entire browse

by vidim on Sun Dec 14, 2014 5:34 pm

Thanks guys for those better solutions.

My current solution sometimes gives me an error 910, but I will try it with these instead.
vidim
 
Posts: 23
Joined: Mon Nov 17, 2014 9:10 am


Return to iMacros for Firefox

Who is online

Users browsing this forum: Bing [Bot] and 15 guests

-->