如何恢复已禁用的console.log?

How to Restore a Disabled console.log?
通过将其拉出iframe,在已删除的页面(如twitter)上恢复console.log

function setConsole() {
var iframe = document.createElement('iframe');
iframe.style.display = 'none';
document.body.appendChild(iframe);
console = iframe.contentWindow.console;
window.console = console;
}

如何恢复已禁用的console.log?的更多相关文章

  1. console.log 被重写覆盖以后如何恢复

    有时候一些项目中会使用类似如下的方式覆盖掉console对象: var console = {}; console.log = function(){}; console.info = functio ...

  2. console.log("正常-普天数据已调用");

    console.log("正常-普天数据已调用");

  3. 禁用所有控制台console.log()打印

    在前端dev的环境下,经常会用到console.log()进行调试,以方便开发, 而在产品release的版本中,又不合适在浏览器的console中输出那么多的调试信息. 但是会经常因为没有删除这些开 ...

  4. vue-cli2.0和vue-cli3.0中当发布到生产环境时禁用console.log

    vue-cli2.0中的方法 1.安装插件 npm install uglifyjs-webpack-plugin --save-dev 2.修改webpack.prod.conf.js配置文件 co ...

  5. JS里try...catch...finally详解,以及console日志调试(console.log、console.info等)

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...

  6. 移动端console.log()调试

    在微信或app进行开发的时候,没法直接查看console.log的输出内容,调试起来简直太痛苦了. 1.笨笨的方法 fiddler抓请求:追加dom节点,显示调试信息. var div =docume ...

  7. GIT 恢复已删除的提交

    在Git中一切的操作都是可以恢复的,包括已经删除的提交,今天在做一个项目时就遇到了这种问题,也不知道是怎么回事不小心就把上午提交的所有代码都删除了,于是赶紧通过git log来查看日志,但奇怪的是当时 ...

  8. console.log出来的信息不一定是真的

    一.问题 拿接口取值,明明this.props.chartsValue[0]已经返回json数据,结果this.props.chartsValue[0].history报错:无法获得undefined ...

  9. console.log与console.dir的区别

    今天学习promise的时候看到了console.dir这个方法,感到很好奇,查了以下感觉又长知识了 在Chrome中,控制台对象定义了两个似乎做同样事情的方法: console.log() cons ...

随机推荐

  1. Springboot-001-解决nested exception is org.apache.ibatis.binding.BindingException: Parameter 'env' not found. Available parameters are [arg1, arg0, param1, param2]

    环境:Springboot + Mybatis + MySQL + VUE 场景: 前端发出数据比对请求,在服务后台与数据库交互时,接口提示错误信息如下所示: { "code": ...

  2. 千万不要随意在网上下载ojdbcjar包来使用,ORA-01461错误解决

    我在登录项目时,点击某一按钮提示ORA-01461: 仅能绑定要插入 LONG 列的 LONG 值,但是项目在我的同事那里可以完好运行.最后百度 发现问题所在: 数据库与客户端的JDBC驱动不匹配. ...

  3. JVM深入:JVM内存堆布局图解分析(转)

    转载自:https://www.cnblogs.com/SaraMoring/p/5713732.html 原文:http://www.codeceo.com/article/jvm-memory-s ...

  4. redis基础2

  5. AngularJS简单例子

    双大括号标记{{}}绑定的表达式 <html ng-app> <script src="http://code.angularjs.org/angular-1.0.1.mi ...

  6. [PCL]模型拟合方法——随机采样一致性

    SACSegmentation封装了多种Ransac方法,包括: RandomSampleConsensus, LeastMedianSquares, MEstimatorSampleConsensu ...

  7. Leetcode: The Maze(Unsolved locked problem)

    There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolli ...

  8. Leetcode: Max Consecutive Ones II(unsolved locked problem)

    Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at mos ...

  9. django的url反向解析

    目的:防止页面中url地址改变,其他与这个URL地址有关联的都要改,减少耦合度 使用:主要分为在html中和视图函数中的使用 HTML中的使用: 如果我们在项目的url文件中通过include导入了应 ...

  10. 使用gulp构建一个项目

    gulp是前端开发过程中自动构建项目的工具,相同作用的还有grunt.构建工具依靠插件能够自动监测文件变化以及完成js/sass/less/html/image/css/coffee等文件的语法检查. ...