c4console.min

15.06.2020, 06:31:18

目前為 2020-06-15 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        c4console.min
// @namespace   Violentmonkey Scripts
// @match       *://*/*
// @exclude-match *://*.google.com*/*
// @run-at      document-start
// @grant       none
// @version     2.3
// @author      Tut 'UniBreakfast' Ninin
// @description 15.06.2020, 06:31:18
// ==/UserScript==
Object.prototype.assign=function(...e){return Object.assign(this,...e)},console.img=((e,t=.4,n=" ")=>{if(e.match(/^data:image\/.*;base64,/))return(new Image).assign({src:e,onload(){console.log(`%c${n}`,`background:no-repeat url(${e});padding:0 ${this.width*t}px ${this.height*t}px 4px;background-size:contain`)}});fetch(e).then(e=>e.blob()).then(e=>(new FileReader).assign({onload(){console.img(this.result,t)}}).readAsDataURL(e))});{let e;window.c=((...e)=>console.log(...e)||e.length>1?e:e[0]);const t=()=>(new Date).toLocaleTimeString("en",{hour12:!1});Object.prototype.c=function(n){const o=t(),s=this.valueOf();return console.log(...o==e?[]:[e=o],..."string"==typeof n?[n+":"]:"number"==typeof n?[n+"."]:[],s),s},Promise.prototype.c=function(n){let o=e=>e,s=e=>e;const a=t(),c=new Date,i="response body",r=(t,o)=>{console.log(...a==e?[]:[e=a],..."string"==typeof n?[n+":"]:"number"==typeof n?[n+"."]:[],`${o} in ${new Date-c}ms`,t),"Response"==t.constructor.name&&200==t.status&&((t.headers.get("content-type")||"").startsWith("image/")?t.clone().blob().then(e=>(new FileReader).assign({onload(){console.img(this.result,.4,i)}}).readAsDataURL(e)):t.clone().text().then(e=>{try{JSON.parse(e).c(i)}catch{e.c(i)}}))},l=this.then(e=>r(e,"resolved")||o(e),e=>r(e,"rejected")||s(e));return this.then=((e,t)=>(e&&(o=e),t&&(s=t),l)),this.catch=l.catch=(e=>(s=e)&&l),this}}