js 检测浏览器开发者控制台是否被打开

var element = new Image();
Object.defineProperty(element, "id", {
  get: function () {
    debugger;
  },
});

requestAnimationFrame(function check() {
  console.dir(element);
  requestAnimationFrame(check);
});

See also:

posted @ 2020-10-12 15:12  Ajanuw  阅读(1157)  评论(0编辑  收藏  举报