Restoring console.log()

后端 未结 8 2399
粉色の甜心
粉色の甜心 2020-11-29 22:25

For some reason, the prototype framework (or another JavaScript code) that is shipped with Magento is replacing standard console functions, so I can\'t debug anything. Writi

8条回答
  •  粉色の甜心
    2020-11-29 22:46

    Since original console is in window.console object, try restoring window.console from iframe:

    var i = document.createElement('iframe');
    i.style.display = 'none';
    document.body.appendChild(i);
    window.console = i.contentWindow.console;
    // with Chrome 60+ don't remove the child node
    // i.parentNode.removeChild(i);
    

    Works for me on Chrome 14.

提交回复
热议问题