mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 11:57:46 +08:00
Allow to toggle Android WebView HardwareAcceleration from JS
Summary: This diff exposes a new prop for WebView in Android to disable HardwareAcceleration. Disabling hardware acceleration is sometimes required to workaround chromium bugs: https://bugs.chromium.org/p/chromium/issues/detail?id=501901 Reviewed By: fkgozali Differential Revision: D13425243 fbshipit-source-id: e3cd53c72d01f74624b60834496f3cc44076b6b5
This commit is contained in:
committed by
Facebook Github Bot
parent
aaa4a38fbc
commit
d1b90ee9e2
@@ -115,6 +115,16 @@ class WebView extends React.Component {
|
||||
*/
|
||||
useWebKit: PropTypes.bool,
|
||||
|
||||
/**
|
||||
* Used on Android only to disable Hardware Acceleration if needed
|
||||
* Hardware acceleration can not be enabled at view level but it can be
|
||||
* disabled see:
|
||||
* https://developer.android.com/guide/topics/graphics/hardware-accel
|
||||
*
|
||||
* @platform android
|
||||
*/
|
||||
hardwareAccelerationEnabledExperimental: PropTypes.bool,
|
||||
|
||||
/**
|
||||
* Used on Android only, JS is enabled by default for WebView on iOS
|
||||
* @platform android
|
||||
@@ -248,6 +258,7 @@ class WebView extends React.Component {
|
||||
javaScriptEnabled: true,
|
||||
thirdPartyCookiesEnabled: true,
|
||||
scalesPageToFit: true,
|
||||
hardwareAccelerationEnabledExperimental: true,
|
||||
saveFormDataDisabled: false,
|
||||
originWhitelist: WebViewShared.defaultOriginWhitelist,
|
||||
};
|
||||
@@ -327,6 +338,9 @@ class WebView extends React.Component {
|
||||
injectedJavaScript={this.props.injectedJavaScript}
|
||||
userAgent={this.props.userAgent}
|
||||
javaScriptEnabled={this.props.javaScriptEnabled}
|
||||
hardwareAccelerationEnabledExperimental={
|
||||
this.props.hardwareAccelerationEnabledExperimental
|
||||
}
|
||||
thirdPartyCookiesEnabled={this.props.thirdPartyCookiesEnabled}
|
||||
domStorageEnabled={this.props.domStorageEnabled}
|
||||
messagingEnabled={typeof this.props.onMessage === 'function'}
|
||||
|
||||
Reference in New Issue
Block a user