Created
February 26, 2018 13:13
-
-
Save winguse/077bdb923dd91580aeda548a26513cb4 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 b64DecodeUnicode(str) { | |
return decodeURIComponent(Array.prototype.map.call(atob(str), function(c) { | |
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2) | |
}).join('')) | |
} | |
var reg = /([A-Za-z0-9+\/=]{10,})/g; | |
document.querySelectorAll('p,span').forEach(e => { | |
var txt = e.innerHTML; | |
if (txt.indexOf('<') >= 0) return; | |
try { e.innerHTML = txt.replace(reg, b64DecodeUnicode); } catch (err) { } | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment