[GH-ISSUE #1] setInterval #1

Closed
opened 2026-03-01 14:33:47 +03:00 by kerem · 1 comment
Owner

Originally created by @katoto on GitHub (Nov 14, 2018).
Original GitHub issue: https://github.com/AEPKILL/devtools-detector/issues/1

setInterval ? 你用500 一直查询?

Originally created by @katoto on GitHub (Nov 14, 2018). Original GitHub issue: https://github.com/AEPKILL/devtools-detector/issues/1 setInterval ? 你用500 一直查询?
kerem 2026-03-01 14:33:47 +03:00
Author
Owner

@AEPKILL commented on GitHub (Nov 14, 2018):

用的 setTimeout 做循环检测,setTimeoutsetInterval 更容易控制。
因为浏览器并没有提供 devtools 打开时的事件,所以必须循环检测。
其实用 requestIdleCallback 方法可以获取最优的性能,但是 IE 浏览器并不支持这个方法。

<!-- gh-comment-id:438663587 --> @AEPKILL commented on GitHub (Nov 14, 2018): 用的 `setTimeout` 做循环检测,`setTimeout` 比 `setInterval` 更容易控制。 因为浏览器并没有提供 `devtools` 打开时的事件,所以必须循环检测。 其实用 `requestIdleCallback` 方法可以获取最优的性能,但是 `IE` 浏览器并不支持这个方法。
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#1
No description provided.