From 081c6da8c9bc8fc948112f7097f559ec925e697d Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Fri, 20 Jul 2018 15:32:41 -0400 Subject: [PATCH 1/4] fix WKWebView via PostInstall script --- package.json | 3 ++- scripts/postinstall.sh | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100755 scripts/postinstall.sh diff --git a/package.json b/package.json index af466631af0..e2af7c15858 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "format": "prettier **/*.{js,json} --write", "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest", - "test:update": "jest -u" + "test:update": "jest -u", + "postinstall": "./scripts/postinstall.sh" }, "prettier": { "printWidth": 120, diff --git a/scripts/postinstall.sh b/scripts/postinstall.sh new file mode 100755 index 00000000000..f2f3dfe1125 --- /dev/null +++ b/scripts/postinstall.sh @@ -0,0 +1,8 @@ +#!/bin/bash +echo "PostInstall script:" + +echo "1 - Fixing WKWebView..." +WKWEBVIEW_FILE=$(find . -name RCTWKWebView.m); +sed -i '' -e 's/injectionTime:WKUserScriptInjectionTimeAtDocumentEnd/injectionTime:WKUserScriptInjectionTimeAtDocumentStart/g' $WKWEBVIEW_FILE; + +echo "Done" \ No newline at end of file From 8d35ef66d534c0cf8ce515878ec19bd174676cd8 Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Fri, 20 Jul 2018 16:28:27 -0400 Subject: [PATCH 2/4] replace specific line --- package.json | 2 +- scripts/postinstall.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index e2af7c15858..3921d5125fe 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "react-native": "0.56.0", "react-native-fs": "^2.10.14", "react-native-vector-icons": "^4.6.0", - "react-native-wkwebview-reborn": "^1.21.0", + "react-native-wkwebview-reborn": "1.21.0", "react-navigation": "^2.6.2" }, "devDependencies": { diff --git a/scripts/postinstall.sh b/scripts/postinstall.sh index f2f3dfe1125..185aadc12cc 100755 --- a/scripts/postinstall.sh +++ b/scripts/postinstall.sh @@ -3,6 +3,5 @@ echo "PostInstall script:" echo "1 - Fixing WKWebView..." WKWEBVIEW_FILE=$(find . -name RCTWKWebView.m); -sed -i '' -e 's/injectionTime:WKUserScriptInjectionTimeAtDocumentEnd/injectionTime:WKUserScriptInjectionTimeAtDocumentStart/g' $WKWEBVIEW_FILE; - +sed -i '' -e '143s/WKUserScriptInjectionTimeAtDocumentEnd/WKUserScriptInjectionTimeAtDocumentStart/' $WKWEBVIEW_FILE; echo "Done" \ No newline at end of file From 6c71e5ef28b667d4028fa2a70f94a9013dc7d72f Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Fri, 20 Jul 2018 16:52:49 -0400 Subject: [PATCH 3/4] postinstall ftw --- app/components/Browser/index.js | 3 --- app/components/BrowserScreen/index.js | 2 +- index.html | 9 +++++++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 index.html diff --git a/app/components/Browser/index.js b/app/components/Browser/index.js index 0cd90262898..bb187d13b62 100644 --- a/app/components/Browser/index.js +++ b/app/components/Browser/index.js @@ -162,9 +162,6 @@ export default class Browser extends Component { - + ); } diff --git a/index.html b/index.html new file mode 100644 index 00000000000..9855f41cc1f --- /dev/null +++ b/index.html @@ -0,0 +1,9 @@ + + + + + + + From 3903eb26921a5c8b55503a442411cb5699eca227 Mon Sep 17 00:00:00 2001 From: brunobar79 Date: Fri, 20 Jul 2018 16:53:41 -0400 Subject: [PATCH 4/4] clean up --- app/components/BrowserScreen/index.js | 2 +- index.html | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 index.html diff --git a/app/components/BrowserScreen/index.js b/app/components/BrowserScreen/index.js index 42e12f719e9..82a959d41b3 100644 --- a/app/components/BrowserScreen/index.js +++ b/app/components/BrowserScreen/index.js @@ -9,7 +9,7 @@ export default class BrowserScreen extends Component { render() { return ( - + ); } diff --git a/index.html b/index.html deleted file mode 100644 index 9855f41cc1f..00000000000 --- a/index.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - -