Skip to content

Instantly share code, notes, and snippets.

@xulapp
Created February 8, 2010 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xulapp/298165 to your computer and use it in GitHub Desktop.
Save xulapp/298165 to your computer and use it in GitHub Desktop.
bindTabOwner.uc.js (selectOwnerOnClose)
// ==UserScript==
// @name bind tab owner
// @description select owner tab on close tab
// @include main
// @compatibility Firefox 3.5 3.6
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2010/02/28 04:50 +09:00
// @note set browser.tabs.selectOwnerOnClose for true[default]
// ==/UserScript==
// @version 2010/02/21 07:20 +09:00
// @version 2010/02/08 23:10 +09:00
['addTab', 'updateCurrentBrowser'].forEach(function(name) {
eval('gBrowser[' + uneval(name) + '] = ' + gBrowser[name].toString().replace(
/\bthis\.mCurrentTab\.owner = null(?=;)/,
''
));
});
eval('gBrowser._beginRemoveTab = ' + gBrowser._beginRemoveTab.toString().replace(
/(\btab\.owner = )(?=null;)/,
'$1aTab.owner || '
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment