Intercept calls to console.log in Chrome

后端 未结 5 2680
醉梦人生
醉梦人生 2020-11-29 03:31

I have a script that I can\'t change that makes a lot of console.log calls. I want to add another layer and respond if the calls contain certain strings. This works in FF, b

5条回答
  •  粉色の甜心
    2020-11-29 04:16

    Can be simply:

    console.log = (m) => terminal.innerHTML = JSON.stringify(m)
    #terminal {background: black; color:chartreuse}
    $ > 
    

提交回复
热议问题