iOS16.4后wkwebview新增inspectable参数,默认no不可调试html页面。若要Safari 开发中调试Web页面,需要添加代码:
// OC
if (@available(iOS 16.4, *)) {
webView.inspectable = true;
} else {
// Fallback on earlier versions
}
// Swift
if #available(iOS 16.4,*) {
webView.isInspectable = true
} else {
Fallback on earlier versions
}