From 4c80b5662182c195c1e319c2cc9acb99b66a56d9 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Fri, 26 Aug 2016 18:02:22 +0900 Subject: [PATCH] Output more logs for debugging --- modules/browser.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index d14e0b82..807df549 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -5634,8 +5634,10 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { attachTabTo : function TSTBrowser_attachTabTo(aChild, aParent, aInfo) /* PUBLIC API */ { - if (!aChild.parentNode || (aParent && !aParent.parentNode)) // do nothing for closed tab! + if (!aChild.parentNode || (aParent && !aParent.parentNode)) { + log('attachTabTo: canceled for already removed tab'); return; + } log('attachTabTo: attach ', aChild._tPos, ' to ', aParent._tPos); @@ -5664,6 +5666,7 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { aChild.getAttribute('pinned') == 'true' || aParent.getAttribute('pinned') == 'true' ) { + log('attachTabTo: already attached'); this.fireAttachedEvent(aChild, aParent); return; } @@ -5810,14 +5813,18 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { detachTab : function TSTBrowser_detachTab(aChild, aInfo) /* PUBLIC API */ { - if (!aChild || !aChild.parentNode) + if (!aChild || !aChild.parentNode) { + log('detachTab: canceled for already removed tab'); return; + } if (!aInfo) aInfo = {}; var parentTab = this.getParentTab(aChild); - if (!parentTab) + if (!parentTab) { + log('detachTab: canceled for an orphan tab'); return; + } log('detachTab: detach ', aChild._tPos, ' from ', parentTab._tPos);