Why is console.log an empty function on some sites in Chrome?

前端 未结 5 2306
有刺的猬
有刺的猬 2021-01-01 22:33

Go to Twitter\'s login page and type the following in the console:

window.addEventListener(\'keypress\', function(e){console.log(\'hello\')}, true)

5条回答
  •  伪装坚强ぢ
    2021-01-01 23:09

    It's a problem with console.log. try this instead:

    window.addEventListener('keypress', function(e){alert('hello')}, true)
    

提交回复
热议问题