console控制台屏蔽console

方案1:

var window = globalThis
var a = function () {
};
window.console.exception = a;
window.console.trace = a;
window.console.info = a;
window.console.log = a;
window.console.warn = a;
window.console.debug = a;
window.console.error = a;
window.console.table = a;



///测试
console.log("hehe")
window.console.log("haha")
console.trace(1)
window.console.table(2)
console.log("123")

或者在js加载前冻结下

object.freeze(window.console)
posted @ 2020-10-03 15:42  公众号python学习开发  阅读(370)  评论(0编辑  收藏  举报