“Un-redefining” Google Chrome's console Object

后端 未结 7 736
失恋的感觉
失恋的感觉 2020-12-31 06:58

I\'m dealing with a system where the following Javascript code (which is out of my control) is being executed early in the page

if (!(\"console\" in window)          


        
7条回答
  •  失恋的感觉
    2020-12-31 07:19

    Assuming the reason you're concerned is that you want to use the console normally as you develop, you could whip up a simple chrome extension that defines console.firebug so that the condition will evaluate to false. That way you don't need to worry about any potential quirky behavior that might arise from using some other frame's console object, nor do you have to worry about repeatedly inserting and deleting a hack as you develop/deploy.

提交回复
热议问题