iOS WKWebView WKPreferences
A WKPreferences object encapsulates the preference settings for a web view. The preferences object associated with a web view is specified by its web view configuration.
WKPreferences对象封装了WebView的首选项设置。与WebView关联的首选项对象由指定其WebViewConfiguration
/** @abstract The minimum font size in points.
@discussion The default value is 0.
*/最小字体大小(以磅为单位)
open var minimumFontSize: CGFloat
/** @abstract A Boolean value indicating whether JavaScript is enabled.
@discussion The default value is YES.
*/开启JS
open var javaScriptEnabled: Bool
/** @abstract A Boolean value indicating whether JavaScript can open
windows without user interaction.
@discussion The default value is NO in iOS and YES in OS X.
*/JavaScript可以打开没有用户交互的窗口
open var javaScriptCanOpenWindowsAutomatically: Bool
/** @abstract A Boolean value indicating whether warnings should be
shown for suspected fraudulent content such as phishing or malware.
@discussion The default value is YES. This feature is currently available
in the following region: China.
*/是否应警告针对可疑的欺诈性内容(例如网络钓鱼或恶意软件)显示
该功能目前在中国可用
@available(iOS 13.0, *)
open var isFraudulentWebsiteWarningEnabled: Bool
extension WKPreferences {
//是否启用Java --- Deprecated
open var javaEnabled: Bool
//是否启用了插件 --- Deprecated
open var plugInsEnabled: Bool
}