From 47af624231ef3a2c885907cd784cff49ea3d6d3c Mon Sep 17 00:00:00 2001 From: piro Date: Fri, 14 Nov 2008 08:10:33 +0000 Subject: [PATCH] =?UTF-8?q?Minefield=203.1b2pre=E3=81=A7=E5=8B=95=E4=BD=9C?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=8F=E3=81=AA=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@3337 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 93 +++++++++++---------- content/treestyletab/treestyletabbrowser.js | 8 +- 2 files changed, 54 insertions(+), 47 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 5dcae43a..be8dbd8c 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1196,51 +1196,54 @@ catch(e) { funcs = 'handleLinkClick __splitbrowser__handleLinkClick __ctxextensions__handleLinkClick __treestyletab__highlander__origHandleLinkClick'.split(' '); for (var i in funcs) { - if (funcs[i] in window && /^function handleLinkClick/.test(window[funcs[i]].toString())) - eval('window.'+funcs[i]+' = '+ - window[funcs[i]].toSource().replace( - /(openNewTabWith\()/g, - <> - ).replace( - /(event.ctrlKey|event.metaKey)/, - <> - ).replace( - 'return false;case 1:', - <> - ) - ); + if (!(funcs[i] in window) || + !/^function handleLinkClick/.test(window[funcs[i]].toString())) + continue; + eval('window.'+funcs[i]+' = '+ + window[funcs[i]].toSource().replace( + /(openNewTabWith\()/g, + <> + ).replace( + /(event.ctrlKey|event.metaKey)/, + <> + ).replace( + 'return false;case 1:', + <> + ) + ); + break; } funcs = 'contentAreaClick __contentAreaClick __ctxextensions__contentAreaClick'.split(' '); diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 6fea4c6a..87e3fb3c 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -457,7 +457,9 @@ TreeStyleTabBrowser.prototype = { }, 0, this); var allTabPopup = document.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'alltabs-popup'); - allTabPopup.addEventListener('popupshowing', this, false); + if (allTabPopup) { + allTabPopup.addEventListener('popupshowing', this, false); + } /* To move up content area on the tab bar, switch tab. If we don't do it, a gray space appears on the content area @@ -827,7 +829,9 @@ TreeStyleTabBrowser.prototype = { tabContext.removeEventListener('popuphiding', this, false); var allTabPopup = document.getAnonymousElementByAttribute(b.mTabContainer, 'anonid', 'alltabs-popup'); - allTabPopup.removeEventListener('popupshowing', this, false); + if (allTabPopup) { + allTabPopup.removeEventListener('popupshowing', this, false); + } if (this.tabbarCanvas) { this.tabbarCanvas.parentNode.removeChild(this.tabbarCanvas);