Return only unique URLs
This commit is contained in:
parent
1a42894f3e
commit
4e4ec57324
@ -87,12 +87,12 @@
|
|||||||
]),
|
]),
|
||||||
|
|
||||||
collectLocations : function(aFrame, aLocations) {
|
collectLocations : function(aFrame, aLocations) {
|
||||||
aLocations = aLocations || [];
|
aLocations = aLocations || {};
|
||||||
aLocations.push(this.getHashString(aFrame.location.href));
|
aLocations[this.getHashString(aFrame.location.href)] = true;
|
||||||
Array.forEach(aFrame.frames, function(aSubFrame) {
|
Array.forEach(aFrame.frames, function(aSubFrame) {
|
||||||
this.collectLocations(aSubFrame, aLocations);
|
this.collectLocations(aSubFrame, aLocations);
|
||||||
}, this);
|
}, this);
|
||||||
return aLocations;
|
return Object.keys(aLocations);
|
||||||
},
|
},
|
||||||
getHashString : function(aString) {
|
getHashString : function(aString) {
|
||||||
let hasher = Cc['@mozilla.org/security/hash;1']
|
let hasher = Cc['@mozilla.org/security/hash;1']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user