debug

用于调试的脚本库

目前為 2017-11-11 提交的版本,檢視 最新版本

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/34143/229636/debug.js

// ==UserScript==
// @name         debug
// @namespace    https://github.com/yeomanye
// @version      0.4
// @include      *://*
// @description  用于调试的脚本库
// @author       Ming Ye
// ==/UserScript==

// 开启调试
var consoleFactory = function(prefix, type,suffix,debugMode) {
    prefix = prefix || "";
    type = type || "log";
    suffix = suffix || "";
    return function(msg){
        if (debugMode) {
            var arguments = Array.prototype.slice.apply(arguments);
            arguments.unshift(prefix);
            arguments.push(suffix);
            console[type].apply(null,arguments)
            // console[type](prefix, msg,suffix);
        }
    };
};

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址