gpt4 book ai didi

javascript - 检测是否通过 getter 查看图像(在控制台中)

转载 作者:行者123 更新时间:2023-12-04 01:08:58 24 4
gpt4 key购买 nike

我想制作一个小脚本来检查控制台是否打开。我看了很多帖子,大多数都说不可能了。然而,我发现一个这样说的:

... I added a small script that would redirect the player to a 404 if they opened devtools.To accomplish this, I created an Image with a getter, which was logged to console. If console was opened, the getter would be triggered, and the user would be 404'd.

这可能吗?如果是,那么如何使用 getter 来完成?

最佳答案

var element = new Image()
Object.defineProperty(element, 'id', {
get() {
alert('Hello')
}
})
console.log(element)

关于javascript - 检测是否通过 getter 查看图像(在控制台中),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65430731/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com