我正在运行edge的铬版本,并安装了ublock origin,我只是想知道如何才能禁止将此脚本加载到网站上。最好是通过覆盖或ublock原点
<script data-cfasync="false" type="text/javascript">
if (-1 != navigator.userAgent.indexOf("Chrome") || -1 != navigator.userAgent.indexOf("Safari") || -1 != navigator.userAgent.indexOf("MSIE") || -1 != navigator.userAgent.indexOf("coc_coc_browser")) {
var checkStatus, element = new Image;
Object.defineProperty(element, "id", {
get: function() {
throw checkStatus = "on", new Error("Dev tools checker")
}
}), setInterval(function() {
checkStatus = "off", console.dir(element), "on" == checkStatus && (-1 != window.location.href.indexOf("?ep=")) && (window.location.href = window.location.href.split("watching.html")[0])
}, 1e3)
} - 1 != navigator.userAgent.indexOf("Firefox") && window.addEventListener("devtoolschange", e => {
1 == e.detail.isOpen && (-1 != window.location.href.indexOf("?ep=")) && (window.location.href = window.location.href.split("watching.html")[0])
});
! function() {
"use strict";
const i = {
isOpen: !1,
orientation: void 0
},
e = (i, e) => {
window.dispatchEvent(new CustomEvent("devtoolschange", {
detail: {
isOpen: i,
orientation: e
}
}))
};
setInterval(() => {
const n = window.outerWidth - window.innerWidth > 160,
o = window.outerHeight - window.innerHeight > 160,
t = n ? "vertical" : "horizontal";
o && n || !(window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized || n || o) ? (i.isOpen && e(!1, void 0), i.isOpen = !1, i.orientation = void 0) : (i.isOpen && i.orientation === t || e(!0, t), i.isOpen = !0, i.orientation = t)
}, 500), "undefined" != typeof module && module.exports ? module.exports = i : window.devtools = i
}();
window.addEventListener("devtoolschange", e => {
e.detail.isOpen && (-1 != window.location.href.indexOf("?ep=")) && (window.location.href = window.location.href.split("watching.html")[0])
});
</script>
发布于 2021-10-13 06:45:38
如果它是一个单独的js文件,您可以阻止特定的js文件加载。打开DevTools -> network选项卡,选择->,然后右键单击-> choose block Request URL。
但如果它被加载到页面上,我认为这是不可能的。如果您选择禁用javascript,则页面的所有脚本内容都将不起作用,这将影响页面的整体运行。
发布于 2021-10-13 22:05:51
uBO有一些很好的工具来阻止这些。
看一看https://github.com/uBlockOrigin/uBlock-issues/wiki/Resources-Library
https://stackoverflow.com/questions/69548292
复制相似问题