Safari内容阻止规则-Safari Content-Blocking Rules

1.通过ID或class隐藏节点

{
  "action": {
       "type": "css-display-none",
        "selector": "#newsletter, div.ads,:matches(.main-page, .article) .news-overlay"
    },
    "trigger": {
        "url-filter": ".*",
        "resource-type": ["image", "style-sheet"],
        "if-domain": ["your-block-server.com", "no-trusted-content-server.com"],
        "unless-domain": ["your-content-server.com", "trusted-content-server.com"]
    }
}

2.禁止某个网站加载第三网网站的script或者其它资源

 {
 "action": {
 "type": "block"
 },
 "trigger": {
 "url-filter": ".*",
 "resource-type":["script"],
 "load-type":["third-party"],
 "if-domain":["m.xxshu5.com","m.huanyue123.com","m.mxguan.com","m.x23us.com","m.shuquge.com"]
 }
 }
 {
 "action": {
 "type": "block"
 },
 "trigger": {
 "url-filter": ".*",
 "if-domain":["www.biqudu.com"],
 "resource-type":["image","script"],
 "load-type":["third-party"]
 }
 }

你可能感兴趣的:(Safari内容阻止规则-Safari Content-Blocking Rules)