Created
October 7, 2019 19:39
-
-
Save matheusmurta/701ec92ade83403ee5d509d5c51dcf43 to your computer and use it in GitHub Desktop.
Remove Alert in console
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
addJS_Node (null, null, overrideSelectNativeJS_Functions); | |
function overrideSelectNativeJS_Functions () { | |
window.alert = function alert (message) { | |
console.log (message); | |
} | |
} | |
function addJS_Node (text, s_URL, funcToRun) { | |
var D = document; | |
var scriptNode = D.createElement ('script'); | |
scriptNode.type = "text/javascript"; | |
if (text) scriptNode.textContent = text; | |
if (s_URL) scriptNode.src = s_URL; | |
if (funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()'; | |
var targ = D.getElementsByTagName ('head')[0] || D.body || D.documentElement; | |
targ.appendChild (scriptNode); | |
} | |
alert = function() {}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment