Created
April 7, 2021 19:48
-
-
Save zvakanaka/2a9879576933b679b655a41755385f6f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 addScript(src) { | |
const s = document.createElement('script'); | |
s.setAttribute('src', src); | |
document.body.appendChild(s); | |
} | |
document.querySelector('pre') && addScript('https://zvakanaka.github.io/console-log/console-log.js'); | |
setTimeout(() => { | |
const el = document.querySelector('pre'); | |
if (el) { | |
const cl = document.createElement('console-log'); | |
el.parentElement.appendChild(cl); | |
const tempText = el.textContent; | |
el.remove(); | |
cl.textContent = tempText; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment