Find_All_Links

Find and show all links on top, update every 10sec

اعتبارا من 21-07-2020. شاهد أحدث إصدار.

// ==UserScript==
// @name         Find_All_Links
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Find and show all links on top, update every 10sec
// @author       x94fujo6
// @match        http://angusnicneven.com/*
// @match        https://angusnicneven.com/*
// ==/UserScript==

(function() {
    'use strict';
    window.onload = function timer(){
        find_all_link();
        setInterval(main,10000);
    }
    function main(){
        document.getElementById("all_links").remove();
        find_all_link();
    }
    function find_all_link(){
        var newdiv = document.createElement("div");
        newdiv.setAttribute = ("id", "all_links");
        var editbody = document.body;
        editbody.insertBefore(newdiv, editbody.firstChild);
        var newList = document.createElement("ul");
        newdiv.appendChild(newList);
        var urls=document.querySelectorAll("a");
        for(var loop=0; loop < urls.length; loop++){
            var newListItem = document.createElement('li');
            newList.appendChild(newListItem);
            var link = document.createElement('a');
            link.href = link.text = urls[loop];
            newListItem.appendChild(link);
        }
    }
})();