NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Visible heap map // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @include * // @copyright 2018, g43riko (https://openuserjs.org/users/g43riko) // @license MIT // ==/UserScript== (function() { const ACTIVATION_KEY = 83; // S const canvas = document.createElement("canvas"); const ctx = canvas.getContext("2d"); canvas.width = window.innerWidth; canvas.height = (document.height !== undefined) ? document.height : document.body.offsetHeight; canvas.style.position = "absolute"; canvas.style.top = canvas.style.left = 0; canvas.style.zIndex = 10000; canvas.style.pointerEvents = "none"; canvas.style.display = "none"; document.body.appendChild(canvas); const oldOnMouseMove = window.onmousemove; const oldOnKezDown = window.onkeydown; window.onmousemove = (e) => { ctx.beginPath(); ctx.arc(e.pageX, e.pageY, 50, 0, 2 * Math.PI, false); ctx.fillStyle = 'rgba(0, 0, 0, 0.01)'; ctx.fill(); oldOnMouseMove && oldOnMouseMove(e); } window.onkeydown = (e) => { if (e.keyCode === ACTIVATION_KEY) { const oldOnKeyUp = window.onkeyup; canvas.style.display = "block"; window.onkeyup = (ee) => { canvas.style.display = "none"; oldOnKeyUp && oldOnKeyUp(ee); } } oldOnKezDown && oldOnKezDown(e); } })()