Return only unique URLs

This commit is contained in:
Piro / YUKI Hiroshi 2016-08-18 22:55:22 +09:00
parent 1a42894f3e
commit 4e4ec57324

View File

@ -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']