Last active
March 14, 2019 22:16
-
-
Save sxslex/cca5ec03ff59269bff7b32884f547488 to your computer and use it in GitHub Desktop.
Troca todo o texto de um site para outro texto passado
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 dePara(de,para){var t=0;if(document.documentElement.innerText.indexOf(de)===-1)return t;Array.from(document.getElementsByTagName("*")).forEach(function(e){Array.from(e.attributes).forEach(function(f){if(['title','alt'].indexOf(f.name)>-1&&f.value){f.value=f.value.split(de).join(para);t++}});e.childNodes.forEach(function(f){if(f.nodeType===3&&f.nodeValue){f.nodeValue=f.nodeValue.split(de).join(para);t++}})});return t} | |
dePara('Compartilhe','Cadê DeDe???'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment