您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
14.09.2020, 17:35:08
当前为
// ==UserScript== // @name console.log With DOM Echo // @namespace Violentmonkey Scripts // @match *://*/* // @grant none // @version 1.0 // @author - // @description 14.09.2020, 17:35:08 // ==/UserScript== const styles = document.createElement("style") styles.innerHTML = ` .console-toast { position: fixed; right: 15px; bottom: -55px; padding: 10px 30px; border-radius: 3px; transition: .3s; color: #fff; font-family: Lato, Roboto, sans-serif; animation: flowUp 10s; } .console-log-toast { background: #3a3a3a; box-shadow: 0 0 7px 0 #7b7b7b; } .console-err-toast { background: #d87070; box-shadow: 0 0 7px 0 #f38d8d; } @keyframes flowUp { 0% { bottom: -55px; } 5% { bottom: 15px; } 75% { bottom: 15px; opacity: 1; } 100% { bottom: 130%; opacity: 0; } } ` document.head.append(styles) const consoleLog = console.log const consoleErr = console.error function consoleToast(type) { return (...args) => { consoleErr(...args) const toast = document.createElement("div") toast.onanimationend = () => toast.remove() toast.className = `console-${type}-toast console-toast` toast.innerText = typeof args[0] == 'function' ? args[0] : JSON.stringify(args.length == 1 ? args[0] : args) document.body.append(toast) } } console.log = consoleToast('log') console.error = consoleToast('err')