Find_All_Links

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

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Find_All_Links
// @namespace    http://tampermonkey.net/
// @version      0.16
// @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() {
        var getshadow = document.getElementById("shadow");
        if (getshadow) { getshadow.remove(); }
        find_all_link();
        setInterval(main, 3000);
    }
    function main() {
        var old_links = document.getElementById("all_links");
        old_links.remove();
        find_all_link();
    }
    function endsWithAny(filterstr, string) {
        return filterstr.some(
            function (suffix) {
                return string.endsWith(suffix);
            }
        );
    }
    function find_all_link() {
        var mycss = "font-weight:bold;color:#ffffff;background-color:#000000;padding:10px;margin:0px;opacity:1;";
        var newdiv = document.createElement("div");
        newdiv.id = "all_links";

        var editbody = document.body;
        editbody.insertBefore(newdiv, editbody.firstChild);

        var newList = document.createElement("ul");
        newList.style.border = "1px solid #ffffff";
        newdiv.appendChild(newList);

        var urls = document.querySelectorAll("[href], a");
        var filterstr = [".css", ".json", ".js", ".png", ".mp3", ".gif"];

        for (var loop = 0; loop < urls.length; loop++) {
            var urltest = urls[loop].getAttribute("href");
            if (endsWithAny(filterstr, urltest)) { continue; }

            var newListItem = document.createElement('li');
            newListItem.style = mycss;
            newList.appendChild(newListItem);

            var link = document.createElement('a');
            link.href = link.text = urls[loop].href;
            newListItem.appendChild(link);
        }

        var linkcount = document.getElementById("all_links").getElementsByTagName("li").length;
        if (linkcount == 0) {
            var nolink = document.createElement('li');
            nolink.style = mycss;
            nolink.textContent = "No link found (Some links need decipher to get)";
            newList.appendChild(nolink);

            var goback = document.createElement('li');
            goback.style = mycss;
            newList.appendChild(goback);

            var gobackurl = document.createElement('a');
            gobackurl.text = "GoBack";
            gobackurl.href = "http://angusnicneven.com/";
            goback.appendChild(gobackurl);
        }
    }
})();