From 1a833760344575f9da132486eff758001ff71d5e Mon Sep 17 00:00:00 2001 From: wanabe Date: Thu, 12 Sep 2013 12:36:00 +0900 Subject: [PATCH 1/2] Improved compatibility with "How Many Times Can I Back?" (#397) "getCommonAncestor" method is not available without jQuery --- modules/browser.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index 395d4895..e5f779d0 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -1079,10 +1079,16 @@ TreeStyleTabBrowser.prototype = { namedNodes.closeAnchor = namedNodes.label; if (namedNodes.closeAnchor.parentNode != namedNodes.close.parentNode) { - let containerFinder = d.createRange(); - containerFinder.selectNode(namedNodes.closeAnchor); - containerFinder.setEndAfter(namedNodes.close); - let container = containerFinder.getCommonAncestor(); + let containerFinder = namedNodes.closeAnchor; + let containers = []; + while (containerFinder != aTab) { + containerFinder = containerFinder.parentNode; + containers.push(containerFinder); + } + let container = namedNodes.close; + while (containers.indexOf(container) < 0) { + container = container.parentNode; + } while (namedNodes.closeAnchor.parentNode != container) { namedNodes.closeAnchor = namedNodes.closeAnchor.parentNode; From 47ac7924e15b12e5f72ed7700ecfab0d62738674 Mon Sep 17 00:00:00 2001 From: wanabe Date: Thu, 12 Sep 2013 14:54:38 +0900 Subject: [PATCH 2/2] Improve compatibility with "How Many Times Can I Back?" (#397) use commonAncestorContainer instead of getCommonAncestor() --- modules/browser.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index e5f779d0..088f42b7 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -1079,16 +1079,10 @@ TreeStyleTabBrowser.prototype = { namedNodes.closeAnchor = namedNodes.label; if (namedNodes.closeAnchor.parentNode != namedNodes.close.parentNode) { - let containerFinder = namedNodes.closeAnchor; - let containers = []; - while (containerFinder != aTab) { - containerFinder = containerFinder.parentNode; - containers.push(containerFinder); - } - let container = namedNodes.close; - while (containers.indexOf(container) < 0) { - container = container.parentNode; - } + let containerFinder = d.createRange(); + containerFinder.selectNode(namedNodes.closeAnchor); + containerFinder.setEndAfter(namedNodes.close); + let container = containerFinder.commonAncestorContainer; while (namedNodes.closeAnchor.parentNode != container) { namedNodes.closeAnchor = namedNodes.closeAnchor.parentNode;