ExplicitMessage_Inject

[DEBUG] 信息显式化(注入版)

目前為 2021-07-18 提交的版本,檢視 最新版本

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

  1. /**
  2. * ExplicitLog_Inject
  3. * @file [DEBUG] 显式日志(注入版)
  4. * @version 2.0.0.20210718
  5. * @author Laster2800
  6. */
  7.  
  8. (function() {
  9. const w = unsafeWindow
  10. const logs = ['log', 'warn', 'error']
  11. for (const log of logs) {
  12. const _ = console[log]
  13. console[log] = function() {
  14. if (w.gm429521?.config.enabled) {
  15. const m = [arguments, log.toUpperCase()]
  16. if (w.gm429521?.fn.match(m, w.gm429521?.config.include) && !w.gm429521?.fn.match(m, w.gm429521?.config.exclude)) {
  17. w.gm429521?.fn.explicit(arguments.length == 1 ? arguments[0] : JSON.stringify(arguments), log.toUpperCase(), GM_info.script.name)
  18. }
  19. }
  20. return _.apply(console, arguments)
  21. }
  22. }
  23. })()

QingJ © 2025

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