在 WebView 中启动 Google Docs 时,我想禁用 Google Docs Header。当我使用 Swift 编码时,我不得不禁用 JavaScript。所以我尝试了同样的方法,但它不起作用。如何从 React-Native WebView 中删除 Google Docs 标头?
import React, { Component } from 'react';
import { StyleSheet,View,WebView } from 'react-native';
import {
Container, Header, Left, Button, Icon, Content,Text
} from 'native-base';
const styles = StyleSheet.create({
wrapper: {
justifyContent: 'center',
flexDirection: 'column',
flex: 1,
},
});
class WebViewContainer extends Component {
render() {
return (
<View style={styles.wrapper}>
<Container>
<Header />
<Content scrollEnabled={false} contentContainerStyle={styles.wrapper}>
<Text>text</Text>
<WebView
injectedJavaScript={false}
javaScriptEnabled={false}
originWhitelist={['*']}
source={{ uri: 'https://docs.google.com/document/d/1VyuUU550TtZNMpX31z9lRSrYFABkthLXi-4qfheq4GU/edit?usp=sharing' }}
/>
<Text>text</Text>
</Content>
</Container>
</View>
);
}
}
export default WebViewContainer;