observerを利用した新型のトレインビューボタン化改造機能

This commit is contained in:
harukin-DeskMini
2022-09-28 03:17:22 +09:00
parent b234b056c3
commit 560649004c
4 changed files with 186 additions and 56 deletions

View File

@@ -1,14 +1,19 @@
const WEBVIEW = "WEBVIEW";
import React, { Component } from 'react';
import { StatusBar,View} from 'react-native';
import {WebView} from 'react-native-webview';
export default function trainbase({route, navigation}) {
import React, { Component } from "react";
import { StatusBar, View } from "react-native";
import { WebView } from "react-native-webview";
const jss = `document.getElementById('Footer').style.display = 'none';`;
export default function trainbase({ route, navigation }) {
const { info } = route.params;
console.log(info);
return (
<View style={{height:"100%"}}>
<WebView source={{uri: info}} useWebKit={true} originWhitelist={['https://train.jr-shikoku.co.jp']}injectedJavaScript={jss}/>
<View style={{ height: "100%" }}>
<WebView
source={{ uri: "https://train.jr-shikoku.co.jp/" + info }}
useWebKit={true}
originWhitelist={["https://train.jr-shikoku.co.jp"]}
injectedJavaScript={jss}
/>
</View>
);
}
const jss = `document.getElementById('Footer').style.display = 'none';`;