[GH-ISSUE #4] google 版本 72.0.3626.121(正式版本) (64 位)不支持 #6

Closed
opened 2026-03-01 14:33:49 +03:00 by kerem · 6 comments
Owner

Originally created by @guoxiaobei on GitHub (Mar 5, 2019).
Original GitHub issue: https://github.com/AEPKILL/devtools-detector/issues/4

支持各个浏览器到什么版本 试了一下谷歌版本 72.0.3626.121(正式版本) (64 位)不支持

Originally created by @guoxiaobei on GitHub (Mar 5, 2019). Original GitHub issue: https://github.com/AEPKILL/devtools-detector/issues/4 支持各个浏览器到什么版本 试了一下谷歌版本 72.0.3626.121(正式版本) (64 位)不支持
kerem 2026-03-01 14:33:49 +03:00
Author
Owner

@AEPKILL commented on GitHub (Mar 6, 2019):

呃 是支持的 我忘了更新 demo 了
现在你再试下呢

<!-- gh-comment-id:469955306 --> @AEPKILL commented on GitHub (Mar 6, 2019): 呃 是支持的 我忘了更新 demo 了 现在你再试下呢
Author
Owner

@guoxiaobei commented on GitHub (Mar 6, 2019):

image
qq浏览器不支持

<!-- gh-comment-id:469956257 --> @guoxiaobei commented on GitHub (Mar 6, 2019): ![image](https://user-images.githubusercontent.com/26620613/53854560-e0f96b80-4004-11e9-83c1-da29fb1a9761.png) qq浏览器不支持
Author
Owner

@guoxiaobei commented on GitHub (Mar 6, 2019):

image
google好像还是不支持呢

<!-- gh-comment-id:469956830 --> @guoxiaobei commented on GitHub (Mar 6, 2019): ![image](https://user-images.githubusercontent.com/26620613/53854671-59602c80-4005-11e9-9f50-ec3c73927bbd.png) google好像还是不支持呢
Author
Owner

@AEPKILL commented on GitHub (Mar 6, 2019):

我看你的截图是没有问题的啊

<!-- gh-comment-id:469958646 --> @AEPKILL commented on GitHub (Mar 6, 2019): 我看你的截图是没有问题的啊
Author
Owner

@guoxiaobei commented on GitHub (Mar 6, 2019):

image
应该是这种的呀

<!-- gh-comment-id:469976777 --> @guoxiaobei commented on GitHub (Mar 6, 2019): ![image](https://user-images.githubusercontent.com/26620613/53858604-d3001680-4015-11e9-81d5-0f9ac09bd246.png) 应该是这种的呀
Author
Owner

@AEPKILL commented on GitHub (Mar 6, 2019):

image
应该是这种的呀

这个只是其中的一种检测方式

devtools-detector 内置了好多种检测方式,在这里查看到所有检查策略: checkers

只要你打开控制台页面上的文字会变成: 'devtools status: open'
关闭控制台页面上的文字会变成: 'devtools status: close'
那么久说明是检测成功的。

如果你只需要这一种检测策略要可以这么写:

import { Detector, debuggerChecker } from 'devtools-detector';

const detector = new Detector({ checkers: [debuggerChecker] });
const view = document.createElement('div');

document.body.appendChild(view);

detector.addListener(
  isOpen =>
    (view.innerText = isOpen
      ? 'devtools status: open'
      : 'devtools status: close')
);

detector.lanuch();

建议你使用默认的检测策略

另外请问你这是什么浏览器啊,按理说 webkit 内核不会触发 debuggerChecker

开发过程中开启检测会影响你调试的,如果你使用了 webpack 之类的构建工具,建议你仅在生产模式下启动检测,像这样:

import { lanuch } from 'devtools-detector';
if (!__DEV__) {
  lanuch();
}
<!-- gh-comment-id:469984896 --> @AEPKILL commented on GitHub (Mar 6, 2019): > ![image](https://user-images.githubusercontent.com/26620613/53858604-d3001680-4015-11e9-81d5-0f9ac09bd246.png) > 应该是这种的呀 这个只是其中的一种检测方式 `devtools-detector` 内置了好多种检测方式,在这里查看到所有检查策略: [checkers](https://github.com/AEPKILL/devtools-detector/tree/master/src/devtools-checker) **只要你打开控制台页面上的文字会变成: 'devtools status: open' 关闭控制台页面上的文字会变成: 'devtools status: close' 那么久说明是检测成功的。** 如果你只需要这一种检测策略要可以这么写: ```typescript import { Detector, debuggerChecker } from 'devtools-detector'; const detector = new Detector({ checkers: [debuggerChecker] }); const view = document.createElement('div'); document.body.appendChild(view); detector.addListener( isOpen => (view.innerText = isOpen ? 'devtools status: open' : 'devtools status: close') ); detector.lanuch(); ``` 建议你使用默认的检测策略 另外请问你这是什么浏览器啊,按理说 `webkit` 内核不会触发 `debuggerChecker` 开发过程中开启检测会影响你调试的,如果你使用了 `webpack` 之类的构建工具,建议你仅在生产模式下启动检测,像这样: ```typescript import { lanuch } from 'devtools-detector'; if (!__DEV__) { lanuch(); } ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/devtools-detector#6
No description provided.