【发布时间】:2018-08-05 00:13:20
【问题描述】:
一个页面在 html 中有以下内容:
<script type="text/javascript">
// some code
</script>
我的greasemonkey 脚本需要阻止该脚本运行。我该怎么做?
更新: 我知道在一般情况下这是不可能的。但是,在我的具体情况下,我可能有漏洞?
<script type="text/javascript">
if (!window.devicePixelRatio) {
// some code that I -don't- want to be run, regardless of the browser
}
</script>
有什么方法可以在嵌入式脚本运行之前定义window.devicePixelRatio?
【问题讨论】: