ExplicitMessage_Inject

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

Stan na 18-07-2021. Zobacz najnowsza wersja.

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/429525/951788/ExplicitMessage_Inject.js

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

/**
 * ExplicitLog_Inject
 * @file [DEBUG] 显式日志(注入版)
 * @version 2.0.1.20210718
 * @author Laster2800
 */

(function() {
  const w = unsafeWindow
  const logs = ['log', 'warn', 'error']
  for (const log of logs) {
    const _ = console[log]
    console[log] = function() {
      if (w.gm429521?.config.enabled) {
        const m = [arguments, log.toUpperCase()]
        if (w.gm429521?.fn.match(m, w.gm429521?.config.include) && !w.gm429521?.fn.match(m, w.gm429521?.config.exclude)) {
          let msg = null
          if (arguments.length == 1) {
            if (typeof arguments[0] == 'object') {
              msg = JSON.stringify(arguments[0])
            } else {
              msg = arguments[0]
            }
          } else {
            msg = JSON.stringify(arguments)
          }
          w.gm429521?.fn.explicit(msg, log.toUpperCase(), GM_info.script.name)
        }
      }
      return _.apply(console, arguments)
    }
  }
})()