ignore firebug console when not installed

后端 未结 9 1236
旧时难觅i
旧时难觅i 2021-02-02 04:15

I use Firebug\'s console.log() for debugging my website. If I try viewing my website in browsers without Firebug then I get a console is not defined er

9条回答
  •  被撕碎了的回忆
    2021-02-02 04:39

    The solution of @OcuS is sure the best, but you can enhance it with mine: Check this way to log to FF Console: Log to Firefox Error Console from JavaScript

    Then add to the firebugx.js this 3 lines inside IF:

    window.console['error'] = li
    window.console['warn'] = li
    window.console['debug'] = li
    

    So you will see the log of every console error, warn and debug even when the Firebug is closed

提交回复
热议问题