From 4e4ec57324f9a81db6728eb9c601b557e6412fc6 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Thu, 18 Aug 2016 22:55:22 +0900 Subject: [PATCH] Return only unique URLs --- content/treestyletab/content-utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/treestyletab/content-utils.js b/content/treestyletab/content-utils.js index 1ac35952..bb89d5cc 100644 --- a/content/treestyletab/content-utils.js +++ b/content/treestyletab/content-utils.js @@ -87,12 +87,12 @@ ]), collectLocations : function(aFrame, aLocations) { - aLocations = aLocations || []; - aLocations.push(this.getHashString(aFrame.location.href)); + aLocations = aLocations || {}; + aLocations[this.getHashString(aFrame.location.href)] = true; Array.forEach(aFrame.frames, function(aSubFrame) { this.collectLocations(aSubFrame, aLocations); }, this); - return aLocations; + return Object.keys(aLocations); }, getHashString : function(aString) { let hasher = Cc['@mozilla.org/security/hash;1']