netnr / LinkRepeat.js
2019-07-10 08:53
页面链接重复查找
  LinkRepeat.js javascript
var lks = document.links, lista = [], repa = [];
for (var i = 0; i < lks.length; i++) {
    var lk = lks[i], link = lk.href;
    link = (link[link.length - 1] == "/" ? link.substring(0, link.length - 1) : link).trim().toLowerCase();
    link = link.replace("http://", "").replace("https://", "");
    lista.indexOf(link) >= 0 ? repa.push(link) : lista.push(link);
}
console.log(repa.join('\n'));
ˆ