From 3f59a46efea56a4fb34ee020abd9b0cbd8fcda9c Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Thu, 21 Jan 2016 20:55:37 +0900 Subject: [PATCH] Suppress "too much recursion" error --- content/treestyletab/windowHelper.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/content/treestyletab/windowHelper.js b/content/treestyletab/windowHelper.js index a1b10c2e..9176d8ee 100644 --- a/content/treestyletab/windowHelper.js +++ b/content/treestyletab/windowHelper.js @@ -75,12 +75,14 @@ var TreeStyleTabWindowHelper = { Object.keys(window.__treestyletab__openLinkIn_extraParams).forEach(function(aKey) { aParams[aKey] = window.__treestyletab__openLinkIn_extraParams[aKey]; }); + var result; try { - return window.__treestyletab__openLinkIn.apply(this, [aUrl, aWhere, aParams].concat(aArgs)); + result = window.__treestyletab__openLinkIn.apply(this, [aUrl, aWhere, aParams].concat(aArgs)); } - finally { - delete window.__treestyletab__openLinkIn_extraParams; + catch(e) { } + delete window.__treestyletab__openLinkIn_extraParams; + return result; }; window.__treestyletab__handleLinkClick = window.handleLinkClick; @@ -89,12 +91,14 @@ var TreeStyleTabWindowHelper = { event : aEvent, linkNode : aLinkNode }; + var result; try { - return window.__treestyletab__handleLinkClick.apply(this, [aEvent, aHref, aLinkNode].concat(aArgs)); + result = window.__treestyletab__handleLinkClick.apply(this, [aEvent, aHref, aLinkNode].concat(aArgs)); } - finally { - delete window.__treestyletab__openLinkIn_extraParams; + catch(e) { } + delete window.__treestyletab__openLinkIn_extraParams; + return result; }; this.overrideExtensionsPreInit(); // windowHelperHacks.js