Keep Last Two Tabs is my first Chrome Extension, I wrote this post because the Extension page is only allowed 2,000 characters in description.

Note

This extension has been abandoned for years. (2016-02-10T04:03:35Z)

This is a silly extension. It’s made to prevent Chrome quits when you close last tab. But it’s not really work as you may expect. It keeps you Chrome has at least two tabs. Because intercepting last tab closing is not possible, therefore this is one possible way to get around.

1   Source Code

You can download it on GitHub.

2   Notes

  • You may want to pin the leftmost tab and leave it there unused.
  • This extension is not for preventing the result after you click on window’s close button by accident. That issue is not possible to resolve by using extension, currently. And this last tab closing and window closing issues are both should be resolved by core code not by extensions. This is just a temporarily silly workaround.
  • How to Close Chrome after installation of this extension? Press Alt+F4 or Click on X button on top-right corner of Chrome window.
  • Note by sozercan: If you have an application shortcut open, it won’t close the main window. (Thanks!)
  • Please go to vote for better tab controlling1.
[1]http://www.google.com/support/chrome/bin/static.py?page=suggestions.cs&issue=107375&bucket=15653 is gone.

3   Issues

  • If there is only one normal tab with one or more pinned tab closed (aka ghost tab? still there, you can click to reopen), Chrome will exit if you close that only normal tab.
  • Currently, ghost tab is not able to be detected, we can see them as normal tabs, therefore we can’t stop this happening. (2010-05-19) Updated 2010-07-24: Ghost tab seems to be removed in Chrome 6.

4   Changelog

  • 0.3.1 2010-08-09 - Do not close new tab which is chrome://newtab/
  • 0.3.0.1 2010-07-25 - Change (fix) the “closing second tab” to be for closing New Tabs. The previous way didn’t cover some situations.
  • 0.3 2010-07-24 - Add new option for closing second tab if there were only two tabs when open new tab and second tab is the New Tab page (chrome://newtab/). (Suggested by manwe)
  • 0.2 2010-02-22 - Add Options page for whether creating tab in background by user decision. (Check the new option, would have behavior like first release)
  • 0.1.1 2010-02-08 - Tab creation in background for better experience (suggested by anonymous)
  • 0.1 2009-12-19 - First release.