Skip to content

Instantly share code, notes, and snippets.

@kdrag0n
Created August 1, 2023 00:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdrag0n/71a3faa97812fcbee0846ea0a1734617 to your computer and use it in GitHub Desktop.
Save kdrag0n/71a3faa97812fcbee0846ea0a1734617 to your computer and use it in GitHub Desktop.
β„π•–π•“π•£π•’π•Ÿπ•• 𝕒𝕝𝕝 π•₯𝕙𝕖 π•₯π•™π•šπ•Ÿπ•˜π•€: β„‚π•™π•šπ•£π•‘ β†’ 𝕋𝕙𝕖 𝕏 π”½π• π•Ÿπ•₯
let csetSrc = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
let csetDest = ['𝕒','𝕓','𝕔','𝕕','𝕖','𝕗','π•˜','𝕙','π•š','𝕛','π•œ','𝕝','π•ž','π•Ÿ','𝕠','𝕑','𝕒','𝕣','𝕀','π•₯','𝕦','𝕧','𝕨','𝕩','π•ͺ','𝕫','𝔸','𝔹','β„‚','𝔻','𝔼','𝔽','𝔾','ℍ','𝕀','𝕁','𝕂','𝕃','𝕄','β„•','𝕆','β„™','β„š','ℝ','π•Š','𝕋','π•Œ','𝕍','π•Ž','𝕏','𝕐','β„€','𝟘','πŸ™','𝟚','πŸ›','𝟜','𝟝','𝟞','𝟟','𝟠','𝟑']
for (let el of document.querySelectorAll('*')) {
// ignore non-user-visible
if (el.style.display == 'none' || el.style.visibility == 'hidden') {
continue
}
if (el.tagName == 'SCRIPT' || el.tagName == 'STYLE' || el.tagName == 'TEXTAREA') {
continue
}
// get text content
if (!el.firstChild) {
continue
}
let text = el.firstChild.nodeValue
if (!text) {
continue
}
let oldText = text
// replace all characters in csetSrc with corresponding characters in csetDest
for (let i = 0; i < csetSrc.length; i++) {
text = text.replaceAll(csetSrc[i], csetDest[i])
}
el.firstChild.nodeValue = text
console.log(`replaced ${oldText} with ${text}`)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment