F12 Newmenu private

自用的F12查看menu

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         F12 Newmenu private
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  自用的F12查看menu
// @author       白水
// @match        *
// @grant        none
// @home-url     https://greasyfork.org/zh-CN/scripts/418796
// ==/UserScript==

(function() {
    'use strict';
    //通过 <H1> 判断是否存在目录
    if (document.getElementsByTagName("h1").length !== 0) {
        var j = 0; //var j = 1; //当前的层级是多少?因为最低是1
        for (var i = 0, ilen = document.all.length; i < ilen; i++) {
            if (document.all[i].tagName.length == 2 && document.all[i].tagName.toString()[0] == "H") {
                if (j < document.all[i].tagName.toString()[1]) {
                    console.group(document.all[i].textContent);
                } else if (j >= document.all[i].tagName.toString()[1]) {
                    for (var k = 0; k < j - document.all[i].tagName.toString()[1] + 1; k++) { console.groupEnd(); }
                    console.group(document.all[i].textContent);
                } else;
                j = document.all[i].tagName.toString()[1];
            }
        }
        for (var l = 0; l < j; l++) { console.groupEnd(); }
    }
})();