V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
darnurash
V2EX  ›  JavaScript

如何查出哪里调用了 Chrome 清除 console 的 js?

  •  
  •   darnurash · 2018-06-20 15:50:09 +08:00 · 3794 次点击
    这是一个创建于 2108 天前的主题,其中的信息可能已经有所发展或是发生改变。

    F12 里的 console 总是被一个 JS 清除,不知因何而起

    7 条回复    2018-06-20 20:17:35 +08:00
    darnurash
        1
    darnurash  
    OP
       2018-06-20 15:50:58 +08:00
    用 Edge 访问同一地址却没有这种情况
    darnurash
        2
    darnurash  
    OP
       2018-06-20 15:51:56 +08:00
    从 Sources 标签页里看,可以发现调用了 https://eluxer.net/code?id=105&subid=51067_5415_
    不知哪里来的🤯
    noe132
        3
    noe132  
       2018-06-20 16:10:12 +08:00   ❤️ 5
    自己 hook 一下 clear。
    const originalClear = console.clear
    console.clear = (...args) => {originalClear.apply(console, args); console.error(new Error('someone cleared console!')); }
    Yechs
        4
    Yechs  
       2018-06-20 16:59:24 +08:00   ❤️ 1
    我这里是 chrome 的一个扩展程序导致的

    Vysor.com
    darnurash
        5
    darnurash  
    OP
       2018-06-20 18:54:47 +08:00
    Tampermonkey 引发的问题
    darnurash
        6
    darnurash  
    OP
       2018-06-20 19:13:18 +08:00
    弄错了,是 Internet Download Manager (IDM)插件引发的
    codehz
        7
    codehz  
       2018-06-20 20:17:35 +08:00
    这种情况其实可以在 sources 面板下用 Ctrl+Shift+F 搜索的(
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1856 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:27 · PVG 00:27 · LAX 09:27 · JFK 12:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.