Any way of getting Ctrl_W not to close Firefox?

User Help for Mozilla Firefox
Post Reply
FrankSMS
Posts: 351
Joined: February 9th, 2017, 4:03 pm

Any way of getting Ctrl_W not to close Firefox?

Post by FrankSMS »

I open a lot of tabs researching things. Firefox is my default browser so, unless there are some problems which is rare, I want it open all the time. Time and time again I get to the last tab and don't realize it, hit Ctrl_W to close it because I'm finished with it and Firefox closes. Is there any way of preventing this from happening? Ctrl_W should close the tab, not the program. Once again Mozilla is contravening convention for no logical reason. Alt_F4 closes the program. Personally I like Alt_W to close the program as its rarely used by anyone and is much easier to implement than Alt_F4 which is a little awkward. The main thing is Ctrl_W shouldn't close the program, just tabs.
Kevin McFarlane
Posts: 597
Joined: November 10th, 2009, 3:47 am

Re: Any way of getting Ctrl_W not to close Firefox?

Post by Kevin McFarlane »

moz2u wrote:Once again Mozilla is contravening convention for no logical reason. Alt_F4 closes the program. Personally I like Alt_W to close the program as its rarely used by anyone and is much easier to implement than Alt_F4 which is a little awkward. The main thing is Ctrl_W shouldn't close the program, just tabs.
All the browsers work this way, not just Firefox. I tried in Edge and Chrome just now.

Having said that, there may be an about:config setting that does what you want. Pre-57 you could do it via Tab Mix Plus and probably other extensions.
User avatar
Reflective
Posts: 2283
Joined: February 15th, 2007, 11:13 am

Re: Any way of getting Ctrl_W not to close Firefox?

Post by Reflective »

A very simple solution is to pin a blank tab (right click, Pin tab).
User avatar
Gingerbread Man
Posts: 7735
Joined: January 30th, 2007, 10:55 am

Re: Any way of getting Ctrl_W not to close Firefox?

Post by Gingerbread Man »

  1. Enter the following in the location bar:

    Code: Select all

    about:config?filter=browser.tabs.closeWindowWithLastTab
  2. Press the big button to bypass the warning.
  3. In the search results, double-click browser.tabs.closeWindowWithLastTab to set it to false.
FrankSMS
Posts: 351
Joined: February 9th, 2017, 4:03 pm

Re: Any way of getting Ctrl_W not to close Firefox?

Post by FrankSMS »

Reflective wrote:A very simple solution is to pin a blank tab (right click, Pin tab).
I right clicked an empty part of the tab but didn't see Pin Tab there as an option. Sounds like an excellent idea. I don't mind doing that once a day! Right now I just open another window of Firefox at about:config to control javascript. That's working OK as well. Solves 2 problems.
FrankSMS
Posts: 351
Joined: February 9th, 2017, 4:03 pm

Re: Any way of getting Ctrl_W not to close Firefox?

Post by FrankSMS »

Gingerbread Man wrote:
  1. Enter the following in the location bar:

    Code: Select all

    about:config?filter=browser.tabs.closeWindowWithLastTab
  2. Press the big button to bypass the warning.
  3. In the search results, double-click browser.tabs.closeWindowWithLastTab to set it to false.
You the man! I just love that "get it done" attitude of about:config! Worked flawlessly. Thank you so much. A perfect solution.
Kevin McFarlane
Posts: 597
Joined: November 10th, 2009, 3:47 am

Re: Any way of getting Ctrl_W not to close Firefox?

Post by Kevin McFarlane »

How about Gingerbread Man's solution?

Edit: ah you beat me to it. :)
FrankSMS
Posts: 351
Joined: February 9th, 2017, 4:03 pm

Re: Any way of getting Ctrl_W not to close Firefox?

Post by FrankSMS »

Is there a guide to about:config somewhere? It can be difficult at times finding stuff as they combine words together sometimes though I must admit I don't try very often.
User avatar
therube
Posts: 21714
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Any way of getting Ctrl_W not to close Firefox?

Post by therube »

Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
User avatar
Reflective
Posts: 2283
Joined: February 15th, 2007, 11:13 am

Re: Any way of getting Ctrl_W not to close Firefox?

Post by Reflective »

moz2u wrote:
Reflective wrote:A very simple solution is to pin a blank tab (right click, Pin tab).
I right clicked an empty part of the tab but didn't see Pin Tab there as an option. Sounds like an excellent idea. I don't mind doing that once a day! Right now I just open another window of Firefox at about:config to control javascript. That's working OK as well. Solves 2 problems.
Here's an extension which can do the same thing (apparently): https://addons.mozilla.org/en-US/firefo ... unpin-tab/

EDIT: Oh, just noticed Gingerbread Man fixed it for you already. But you can use the extension to pin sites you want to keep open maybe.
FrankSMS
Posts: 351
Joined: February 9th, 2017, 4:03 pm

Re: Any way of getting Ctrl_W not to close Firefox?

Post by FrankSMS »

Doesn't mention how to find anything. Their search feature is a very poor solution to this problem. When you don't know how to describe or name something searching for it can be rather fruitless. They need to organize things in categories, like most everything else we need to find.

Today I wanted to modify the Ebay search engine to Ebay.com from Ebay.ca because I'm in Canada and it defaults to the (totally useless) Ebay.ca but it seems impossible. Something is controlling this URL location but I have no idea how to edit it. You'd think you could just right click in Options but no luck.

Just an example. It may be in about:config but after doing a search I found nothing relevant. Keyword searching is useful but only if you know the keyword. Someone needs to write a guide on about:config so the rest of us can find more stuff.
User avatar
Gingerbread Man
Posts: 7735
Joined: January 30th, 2007, 10:55 am

Re: Any way of getting Ctrl_W not to close Firefox?

Post by Gingerbread Man »

moz2u wrote:Today I wanted to modify the Ebay search engine to Ebay.com from Ebay.ca
One of the eBay US search engines below should do the trick:
:arrow: http://mycroftproject.com/ebay-search-plugins.html

Editing current search engines is probably best to forget about. They're kept in search.json.mozlz4 in the profile folder, and I don't know what can open files compressed with LZ4. Even if you could, you'd have to edit the JSON file, a format that isn't very readable.

If you have your own search plug-in XML though, you can add it as follows:
  1. Enter the following into the location bar:

    Code: Select all

    about:config?filter=devtools.chrome.enabled
  2. Press the big button to bypass the warning.
  3. In the search results, if devtools.chrome.enabled is set to false, double-click it to set it to true.
  4. Open your XML file in Firefox (you can simply drag and drop it over the window). Copy the address in the location bar to the clipboard.
  5. Open the Browser Console from the Menu Button → Web Developer → Browser Console (Ctrl+Shift+J).
  6. In the text field at the bottom of the Browser Console window, enter the following:

    Code: Select all

    Services.search.addEngine("PASTE THE CLIPBOARD ADDRESS HERE", null, null, false);
User avatar
therube
Posts: 21714
Joined: March 10th, 2004, 9:59 pm
Location: Maryland USA

Re: Any way of getting Ctrl_W not to close Firefox?

Post by therube »

They're kept in search.json.mozlz4 in the profile folder, and I don't know what can open files compressed with LZ4.
dejsonlz4 worked for me.
In any case, you're right. Not worth the effort to deal with black boxes like that.
Fire 750, bring back 250.
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball CopyURL+ FetchTextURL FlashGot NoScript
nohamelin
Posts: 96
Joined: September 3rd, 2013, 4:04 pm
Location: Chile

Re: Any way of getting Ctrl_W not to close Firefox?

Post by nohamelin »

I put available some scripts to add/recover the installed search engines doing the formatting change to XML openSearch, not necessity to deal with json or lz4 tools.
Brummelchen
Posts: 4480
Joined: March 19th, 2005, 10:51 am

Re: Any way of getting Ctrl_W not to close Firefox?

Post by Brummelchen »

Doesn't mention how to find anything. Their search feature is a very poor solution to this problem.
no problem for me when using the right terms. thus need no experience, only logical and maybe a click more after reading. so many cross links between articles.
Post Reply