React-Native 打开 WebView Google 删除文档 header

React-Native WebView open Google Docs remove header

启动时 Google WebView 中的文档 我想禁用 Google 文档 Header。 当我使用 Swift 编码时,我不得不禁用 JavaScript。 所以我尝试了同样的方法,但它不起作用。 如何从 React-Native WebView 中删除 Google 文档 header?

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;

https://snack.expo.io/r1mBAV-64

问题是 javaScriptEnabled 不适用于 IOS。

您可以修改 react-native-webview 以便应用 javaScriptEnabled

https://github.com/aksmfosef11/react-native-webview/tree/add-javascriptEnabled-in-IOS

此功能也已添加到母版中。获取

https://github.com/react-native-community/react-native-webview