ExplicitMessage_Inject

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

目前为 2021-07-20 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/429525/952265/ExplicitMessage_Inject.js

  1. /**
  2. * ExplicitMessage_Inject
  3. * @file [DEBUG] 信息显式化(注入版)
  4. * @version 1.2.1.20210720
  5. * @author Laster2800
  6. */
  7.  
  8. (function() {
  9. let updateAlerted = false
  10. const injectVersion = 20210720
  11. for (const n of ['log', 'warn', 'error']) {
  12. const log = console[n]
  13. console[n] = function() {
  14. if (unsafeWindow.gm429521?.fn?.wrappedLog) {
  15. const gm = unsafeWindow.gm429521
  16. if (injectVersion != gm.injectUpdate) {
  17. if (!updateAlerted) {
  18. updateAlerted = true
  19. gm.fn.updateCheck?.(GM_info.script.name, injectVersion > gm.injectUpdate)
  20. }
  21. console[n] = log
  22. } else {
  23. console[n] = gm.fn.wrappedLog(console, log, n.toUpperCase(), GM_info.script.name)
  24. }
  25. console[n].apply(console, arguments)
  26. } else {
  27. log.apply(console, arguments)
  28. }
  29. }
  30. }
  31. })()

QingJ © 2025

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