iOS 11:WKWebView内容过滤规则详解
使用方法
[{
"trigger": {
"url-filter": ".*" },
"action": {
"type": "make-https"}
}]WKContentRuleListStore.default().compileContentRuleList(
forIdentifier: "ContentBlockingRules",
encodedContentRuleList: jsonString) { (contentRuleList, error) in
if let error = error {
return
}
let configuration = WKWebViewConfiguration()
configuration.userContentController.add(ruleList!)
}可使用的处理方式:Action
规则触发器:trigger
总结
参考
Last updated