Summon eruda devtool when you cast the spell.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function () { | |
var step = 0 | |
function load (url, callback) { | |
var script = document.createElement('script'); | |
script.src = url; | |
script.onload = callback; | |
document.body.appendChild(script); | |
} | |
function summonEruda (e) { | |
if (e.target.dataset && e.target.dataset.summonEruda) { | |
step++ | |
if (step >= 8) { | |
load('//cdn.jsdelivr.net/npm/eruda', function () { | |
eruda.init() | |
load('//cdn.jsdelivr.net/npm/eruda-dom', function () { | |
eruda.add(erudaDom); | |
}) | |
}) | |
document.body.removeEventListener('click', summonEruda) | |
} | |
} | |
} | |
document.body.addEventListener('click', summonEruda) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The repo of eruda devtool: https://github.com/liriliri/eruda
The spell: add attribute
data-summon-eruda="true"
to any element, then click it for more than 8 times.minified: