0
我有一些網頁,有這樣一個javascript:禁用頁面上的所有腳本除了Chrome擴展的背景的javascript
一些頁面
<script>
document.location = "http://example.com"
</script>
manifest.js
"content_scripts": [{
"matches" : ["https://thepage.com/*"],
"js" : ["background.js"]
}
有沒有辦法阻止頁面重定向到http://example.com或disa在頁面中使用background.js可以清除所有腳本??
if(redirectingThePage) {
// stop redirecting and load normally
}
查看chrome.contentSettings API的示例以禁用JavaScript執行。 – wOxxOm