Bladeren bron

Merge branch 'master' into android-permissions

Thibaud Michel 4 jaren geleden
bovenliggende
commit
72dd8dd077
No account linked to committer's email address

+ 1
- 1
.circleci/config.yml Bestand weergeven

@@ -34,7 +34,7 @@ jobs:
34 34
             - node_modules-{{ arch }}-{{ checksum "yarn.lock" }}
35 35
 
36 36
       - run:
37
-          name: Run Tests
37
+          name: Lint checks
38 38
           command: yarn ci
39 39
 
40 40
   publish:

+ 1
- 1
.github/workflows/detox.yml Bestand weergeven

@@ -1,5 +1,5 @@
1 1
 name: 'Detox CI Tests'
2
-on: [push]
2
+on: [pull_request]
3 3
 
4 4
 jobs:
5 5
   tests:

+ 108
- 0
.github/workflows/scripts/install-vs-features.ps1 Bestand weergeven

@@ -0,0 +1,108 @@
1
+param (
2
+	[Parameter(Mandatory=$true)]
3
+	[string[]] $Components,
4
+
5
+	[uri] $InstallerUri = "https://download.visualstudio.microsoft.com/download/pr/c4fef23e-cc45-4836-9544-70e213134bc8/1ee5717e9a1e05015756dff77eb27d554a79a6db91f2716d836df368381af9a1/vs_Enterprise.exe",
6
+
7
+	[string] $VsInstaller = "${env:System_DefaultWorkingDirectory}\vs_Enterprise.exe",
8
+
9
+	[string] $VsInstallOutputDir = "${env:System_DefaultWorkingDirectory}\vs",
10
+
11
+	[System.IO.FileInfo] $VsInstallPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise",
12
+
13
+	[System.IO.FileInfo] $VsInstallerPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer",
14
+
15
+	[switch] $Collect = $false,
16
+
17
+	[switch] $Cleanup = $false,
18
+
19
+	[switch] $UseWebInstaller = $false
20
+)
21
+
22
+$Components | ForEach-Object {
23
+	$componentList += '--add', $_
24
+}
25
+
26
+$LocalVsInstaller = "$VsInstallerPath\vs_installershell.exe"
27
+
28
+$UseWebInstaller = $UseWebInstaller -or -not (Test-Path -Path "$LocalVsInstaller")
29
+
30
+if ($UseWebInstaller) {
31
+	Write-Host "Downloading web installer..."
32
+
33
+	Invoke-WebRequest -Method Get `
34
+		-Uri $InstallerUri `
35
+		-OutFile $VsInstaller
36
+
37
+	New-Item -ItemType directory -Path $VsInstallOutputDir
38
+
39
+	Write-Host "Running web installer to download requested components..."
40
+
41
+	Start-Process `
42
+		-FilePath "$VsInstaller" `
43
+		-ArgumentList ( `
44
+			'--layout', "$VsInstallOutputDir",
45
+			'--wait',
46
+			'--norestart',
47
+			'--quiet' + `
48
+			$componentList
49
+		) `
50
+		-Wait `
51
+		-PassThru
52
+
53
+	Write-Host "Running downloaded VS installer to add requested components..."
54
+
55
+	Start-Process `
56
+		-FilePath "$VsInstallOutputDir\vs_Enterprise.exe" `
57
+		-ArgumentList (
58
+			'modify',
59
+			'--installPath', "`"$VsInstallPath`"" ,
60
+			'--wait',
61
+			'--norestart',
62
+			'--quiet' + `
63
+			$componentList
64
+		) `
65
+		-Wait `
66
+		-PassThru `
67
+		-OutVariable returnCode
68
+
69
+	if ($Cleanup) {
70
+		Write-Host "Cleaning up..."
71
+
72
+		Remove-Item -Path $VsInstaller
73
+		Remove-Item -Path $VsInstallOutputDir -Recurse
74
+	}
75
+	
76
+} else {
77
+	Write-Host "Running local installer to add requested components..."
78
+
79
+	Start-Process `
80
+		-FilePath "$LocalVsInstaller" `
81
+		-ArgumentList (
82
+			'modify',
83
+			'--installPath', "`"$VsInstallPath`"" ,
84
+			'--norestart',
85
+			'--quiet' + `
86
+			$componentList
87
+		) `
88
+		-Wait `
89
+		-OutVariable returnCode
90
+}
91
+
92
+if ($Collect) {
93
+	Invoke-WebRequest -Method Get `
94
+		-Uri 'https://download.microsoft.com/download/8/3/4/834E83F6-C377-4DCE-A757-69A418B6C6DF/Collect.exe' `
95
+		-OutFile ${env:System_DefaultWorkingDirectory}\Collect.exe
96
+
97
+	# Should generate ${env:Temp}\vslogs.zip
98
+	Start-Process `
99
+		-FilePath "${env:System_DefaultWorkingDirectory}\Collect.exe" `
100
+		-Wait `
101
+		-PassThru
102
+
103
+	New-Item -ItemType Directory -Force ${env:System_DefaultWorkingDirectory}\vslogs
104
+	Expand-Archive -Path ${env:TEMP}\vslogs.zip -DestinationPath ${env:System_DefaultWorkingDirectory}\vslogs\
105
+
106
+	Write-Host "VC versions after installation:"
107
+	Get-ChildItem -Name "$VsInstallPath\VC\Tools\MSVC\"
108
+}

+ 67
- 0
.github/workflows/windows-ci.yml Bestand weergeven

@@ -0,0 +1,67 @@
1
+name: Windows CI
2
+on: [pull_request]
3
+
4
+jobs:
5
+  run-windows-tests:
6
+    name: Build & run tests
7
+    runs-on: windows-2019
8
+
9
+    steps:
10
+    - uses: actions/checkout@v2
11
+      name: Checkout Code
12
+     
13
+    - name: Setup Node.js
14
+      uses: actions/setup-node@v1
15
+      with:
16
+        node-version: '12.9.1'
17
+
18
+    - name: Install Visual Studio components
19
+      shell: powershell
20
+      run: .\.github\workflows\scripts\install-vs-features.ps1 Microsoft.VisualStudio.Component.VC.v141.x86.x64,Microsoft.VisualStudio.ComponentGroup.UWP.VC.v141
21
+
22
+    - name: Setup MSBuild
23
+      uses: microsoft/setup-msbuild@v1.0.0
24
+      with:
25
+        vs-version: 16.5
26
+       
27
+    - name: Setup NuGet
28
+      uses: NuGet/setup-nuget@v1.0.2
29
+
30
+    - name: Check node modules cache
31
+      uses: actions/cache@v1
32
+      id: yarn-cache
33
+      with:
34
+        path: ./node_modules
35
+        key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
36
+        restore-keys: |
37
+          ${{ runner.os }}-yarn-
38
+
39
+    - name: Install node modules
40
+      if: steps.yarn-cache.outputs.cache-hit != 'true'
41
+      run: yarn --pure-lockfile
42
+    
43
+    - name: yarn build
44
+      if: steps.yarn-cache.outputs.cache-hit == 'true'
45
+      run: |
46
+        yarn build
47
+        yarn tsc
48
+ 
49
+    - name: NuGet restore
50
+      run: nuget restore example\windows\WebViewWindows.sln
51
+
52
+    - name: Build x64 release
53
+      run: msbuild example\windows\WebViewWindows.sln /p:Configuration=Release /p:Platform=x64 -m
54
+
55
+    - name: Deploy
56
+      shell: powershell
57
+      run: |
58
+        cd example
59
+        Copy-Item -Path windows\x64\Release -Recurse -Destination windows\
60
+        npx react-native run-windows --arch x64 --release --no-build --no-packager
61
+
62
+    - name: Start Appium server
63
+      shell: powershell
64
+      run: Start-Process PowerShell -ArgumentList "yarn appium"
65
+      
66
+    - name: Run tests
67
+      run: yarn test:windows

+ 2
- 0
.gitignore Bestand weergeven

@@ -57,3 +57,5 @@ lib/
57 57
 .classpath
58 58
 .project
59 59
 .settings/
60
+msbuild.binlog
61
+example/msbuild.binlog

+ 31
- 0
__tests__/Alert.test.js Bestand weergeven

@@ -0,0 +1,31 @@
1
+/**
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+import { driver, By2 } from 'selenium-appium'
7
+import { until } from 'selenium-webdriver';
8
+
9
+const setup = require('../jest-setups/jest.setup');
10
+jest.setTimeout(50000);
11
+
12
+beforeAll(() => {
13
+  return driver.startWithCapabilities(setup.capabilites);
14
+});
15
+
16
+afterAll(() => {
17
+  return driver.quit();
18
+});
19
+
20
+describe('Alert Tests', () => {
21
+  
22
+  test('Show Alert', async () => {
23
+    const showAlertButton = await driver.wait(until.elementLocated(By2.nativeName('Show alert')));
24
+    await showAlertButton.click();
25
+    await driver.wait(until.elementLocated(By2.nativeName('Hello! I am an alert box!')));
26
+    await By2.nativeName('OK').click();
27
+    const dismissMessage = await driver.wait(until.elementLocated(By2.nativeName('Alert dismissed!')));
28
+    expect(dismissMessage).not.toBeNull();
29
+  });
30
+
31
+});

+ 1
- 1
docs/Guide.md Bestand weergeven

@@ -55,7 +55,7 @@ class MyWeb extends Component {
55 55
 
56 56
 ### Loading local HTML files
57 57
 
58
-Sometimes you would have bundled an HTML file along with the app and would like to load the HTML asset into your WebView. To do this on iOS, you can just import the html file like any other asset as shown below.
58
+Sometimes you would have bundled an HTML file along with the app and would like to load the HTML asset into your WebView. To do this on iOS and Windows, you can just import the html file like any other asset as shown below.
59 59
 
60 60
 ```js
61 61
 import React, { Component } from 'react';

+ 14
- 0
example/App.tsx Bestand weergeven

@@ -16,6 +16,7 @@ import Background from './examples/Background';
16 16
 import Downloads from './examples/Downloads';
17 17
 import Uploads from './examples/Uploads';
18 18
 import Injection from './examples/Injection';
19
+import LocalPageLoad from './examples/LocalPageLoad';
19 20
 
20 21
 const TESTS = {
21 22
   Alerts: {
@@ -66,6 +67,14 @@ const TESTS = {
66 67
       return <Injection />;
67 68
     },
68 69
   },
70
+  PageLoad: {
71
+    title: 'LocalPageLoad',
72
+    testId: 'LocalPageLoad',
73
+    description: 'Local Page load test',
74
+    render() {
75
+      return <LocalPageLoad />;
76
+    },
77
+  },
69 78
 };
70 79
 
71 80
 type Props = {};
@@ -124,6 +133,11 @@ export default class App extends Component<Props, State> {
124 133
             title="Injection"
125 134
             onPress={() => this._changeTest('Injection')}
126 135
           />
136
+          <Button
137
+            testID="testType_pageLoad"
138
+            title="LocalPageLoad"
139
+            onPress={() => this._changeTest('PageLoad')}
140
+          />
127 141
           {Platform.OS == "ios" && <Button
128 142
             testID="testType_downloads"
129 143
             title="Downloads"

+ 9
- 0
example/assets/test.html Bestand weergeven

@@ -0,0 +1,9 @@
1
+<!doctype html>
2
+<html>
3
+    <head>
4
+        <title>Test</title>
5
+    </head>
6
+    <body>
7
+        <h2>Local page test</h2>
8
+    </body>
9
+</html>

+ 16
- 0
example/examples/LocalPageLoad.tsx Bestand weergeven

@@ -0,0 +1,16 @@
1
+import React, {Component} from 'react';
2
+import {View, Text, Alert, TextInput, Button} from 'react-native';
3
+import WebView from 'react-native-webview';
4
+const localHtmlFile = require('../assets/test.html');
5
+
6
+export default class LocalPageLoad extends Component<Props, State> {
7
+    render() {
8
+      return (
9
+        <View>
10
+            <View style={{ width: '100%', height: '100%' }}>
11
+                <WebView source={localHtmlFile}/>
12
+          </View>
13
+        </View>
14
+      );
15
+    }
16
+  }

+ 1
- 0
example/windows/.gitignore Bestand weergeven

@@ -1,5 +1,6 @@
1 1
 *AppPackages*
2 2
 *BundleArtifacts*
3
+*Bundle
3 4
 
4 5
 #OS junk files
5 6
 [Tt]humbs.db

+ 1
- 1
example/windows/WebViewWindows/Package.appxmanifest Bestand weergeven

@@ -7,7 +7,7 @@
7 7
   IgnorableNamespaces="uap mp">
8 8
 
9 9
  <Identity
10
-    Name="6b4ef5e9-85c1-4006-87d7-77c61c62f84f"
10
+    Name="WebViewWindows"
11 11
     Publisher="CN=kaigu"
12 12
     Version="1.0.0.0" />
13 13
 

+ 4
- 2
example/windows/WebViewWindows/WebViewWindows.vcxproj Bestand weergeven

@@ -18,6 +18,7 @@
18 18
     <PackageCertificateKeyFile>WebViewWindows_TemporaryKey.pfx</PackageCertificateKeyFile>
19 19
     <PackageCertificateThumbprint>82A0D300B0912A62746FFB3E6E04F88985BC2798</PackageCertificateThumbprint>
20 20
     <PackageCertificatePassword>password</PackageCertificatePassword>
21
+    <AppxPackageSigningEnabled>true</AppxPackageSigningEnabled>
21 22
   </PropertyGroup>
22 23
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
23 24
   <ItemGroup Label="ProjectConfigurations">
@@ -145,6 +146,7 @@
145 146
   <ItemGroup>
146 147
     <None Include="packages.config" />
147 148
     <None Include="PropertySheet.props" />
149
+    <None Include="WebViewWindows_TemporaryKey.pfx" />
148 150
     <Text Include="readme.txt">
149 151
       <DeploymentContent>false</DeploymentContent>
150 152
     </Text>
@@ -160,8 +162,8 @@
160 162
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
161 163
   <PropertyGroup>
162 164
     <BundleCommand>
163
-      cd $(SolutionDir)..
164
-      react-native bundle --platform windows --entry-file example/index.js --bundle-output windows/$(SolutionName)/Bundle/index.windows.bundle --assets-dest windows/$(SolutionName)/Bundle
165
+      cd $(SolutionDir)..\..
166
+      npx react-native bundle --platform windows --entry-file example/index.js --bundle-output example/windows/WebViewWindows/Bundle/index.windows.bundle --assets-dest example/windows/WebViewWindows/Bundle --use-react-native-windows
165 167
     </BundleCommand>
166 168
   </PropertyGroup>
167 169
   <Import Project="..\..\..\node_modules\react-native-windows\PropertySheets\Bundle.Cpp.targets" />

+ 1
- 0
example/windows/WebViewWindows/WebViewWindows.vcxproj.filters Bestand weergeven

@@ -51,6 +51,7 @@
51 51
   <ItemGroup>
52 52
     <None Include="PropertySheet.props" />
53 53
     <None Include="packages.config" />
54
+    <None Include="WebViewWindows_TemporaryKey.pfx" />
54 55
   </ItemGroup>
55 56
   <ItemGroup>
56 57
     <Text Include="readme.txt" />

+ 12
- 0
jest-setups/jest.setup.js Bestand weergeven

@@ -0,0 +1,12 @@
1
+import { windowsAppDriverCapabilities } from 'selenium-appium'
2
+
3
+switch (platform) {
4
+    case "windows":
5
+        const webViewWindowsAppId = 'WebViewWindows_3x6rhkkr9xcf6!App';
6
+        module.exports = {
7
+            capabilites: windowsAppDriverCapabilities(webViewWindowsAppId)
8
+        }
9
+        break;
10
+    default:
11
+        throw "Unknown platform: " + platform;
12
+}

+ 1
- 0
jest-setups/jest.setup.windows.js Bestand weergeven

@@ -0,0 +1 @@
1
+platform = "windows"

+ 11
- 7
package.json Bestand weergeven

@@ -16,12 +16,13 @@
16 16
     "start:ios": "react-native run-ios --project-path example/ios --scheme example",
17 17
     "start:macos": "node node_modules/react-native-macos/local-cli/cli.js start --use-react-native-macos",
18 18
     "start:windows": "react-native start --use-react-native-windows",
19
-    "ci": "CI=true && yarn lint && yarn test",
19
+    "ci": "CI=true && yarn lint",
20 20
     "ci:publish": "yarn semantic-release",
21 21
     "lint": "yarn tsc --noEmit && yarn eslint ./src --ext .ts,.tsx",
22 22
     "build": "yarn tsc",
23 23
     "prepare": "yarn build",
24
-    "test": "yarn jest"
24
+    "appium": "appium",
25
+    "test:windows": "yarn jest --setupFiles=./jest-setups/jest.setup.windows.js"
25 26
   },
26 27
   "rn-docs": {
27 28
     "title": "Webview",
@@ -29,8 +30,7 @@
29 30
   },
30 31
   "peerDependencies": {
31 32
     "react": "^16.9",
32
-    "react-native": ">=0.60 <0.62",
33
-    "react-native-windows": "^0.61.0-beta.58"
33
+    "react-native": ">=0.60 <0.62"
34 34
   },
35 35
   "dependencies": {
36 36
     "escape-string-regexp": "2.0.0",
@@ -47,6 +47,7 @@
47 47
     "@types/jest": "24.0.18",
48 48
     "@types/react": "16.8.8",
49 49
     "@types/react-native": "0.60.11",
50
+    "@types/selenium-webdriver": "4.0.9",
50 51
     "@typescript-eslint/eslint-plugin": "2.1.0",
51 52
     "@typescript-eslint/parser": "2.1.0",
52 53
     "babel-eslint": "10.0.3",
@@ -60,14 +61,17 @@
60 61
     "eslint-plugin-react": "7.14.3",
61 62
     "eslint-plugin-react-native": "3.7.0",
62 63
     "jest": "24.9.0",
64
+    "metro": "0.56.4",
63 65
     "metro-react-native-babel-preset": "0.54.1",
64 66
     "react": "16.9.0",
65 67
     "react-native": "0.61.5",
66 68
     "react-native-macos": "0.60.0-microsoft.73",
67
-    "react-native-windows": "^0.61.0-beta.58",
68
-    "rnpm-plugin-windows": "^0.5.1-0",
69
+    "react-native-windows": "0.61.5",
69 70
     "semantic-release": "15.13.24",
70
-    "typescript": "3.6.2"
71
+    "typescript": "3.6.2",
72
+    "appium": "1.17.0",
73
+    "selenium-appium": "0.0.15",
74
+    "selenium-webdriver": "4.0.0-alpha.7"
71 75
   },
72 76
   "repository": {
73 77
     "type": "git",

+ 15
- 15
windows/ReactNativeWebView/ReactWebView.cpp Bestand weergeven

@@ -97,7 +97,7 @@ namespace winrt::ReactNativeWebView::implementation {
97 97
                 eventDataWriter.WriteObjectEnd();
98 98
             });
99 99
 
100
-        winrt::hstring windowAlert = L"window.alert = function (msg) {window.external.notify(`{\"type\":\"alert\",\"message\":\"${msg}\"}`)};";
100
+        winrt::hstring windowAlert = L"window.alert = function (msg) {window.external.notify(`{\"type\":\"__alert\",\"message\":\"${msg}\"}`)};";
101 101
         winrt::hstring postMessage = L"window.ReactNativeWebView = {postMessage: function (data) {window.external.notify(String(data))}};";
102 102
         m_webView.InvokeScriptAsync(L"eval", { windowAlert + postMessage });
103 103
     }
@@ -119,26 +119,26 @@ namespace winrt::ReactNativeWebView::implementation {
119 119
 
120 120
     void ReactWebView::OnScriptNotify(winrt::IInspectable const& /*sender*/, winrt::Windows::UI::Xaml::Controls::NotifyEventArgs const& args) {
121 121
         winrt::JsonObject jsonObject;
122
-        if (winrt::JsonObject::TryParse(args.Value(), jsonObject)) {
122
+        if (winrt::JsonObject::TryParse(args.Value(), jsonObject) && jsonObject.HasKey(L"type")) {
123 123
             auto type = jsonObject.GetNamedString(L"type");
124
-            if (type == L"alert") {
124
+            if (type == L"__alert") {
125 125
                 auto dialog = winrt::MessageDialog(jsonObject.GetNamedString(L"message"));
126 126
                 dialog.Commands().Append(winrt::UICommand(L"OK"));
127 127
                 dialog.ShowAsync();
128
+                return;
128 129
             }
129 130
         }
130
-        else {
131
-            m_reactContext.DispatchEvent(
132
-                m_webView,
133
-                L"topMessage",
134
-                [&](winrt::Microsoft::ReactNative::IJSValueWriter const& eventDataWriter) noexcept {
135
-                    eventDataWriter.WriteObjectBegin();
136
-                    {
137
-                        WriteProperty(eventDataWriter, L"data", winrt::to_string(args.Value()));
138
-                    }
139
-                    eventDataWriter.WriteObjectEnd();
140
-                });
141
-        }
131
+
132
+        m_reactContext.DispatchEvent(
133
+            m_webView,
134
+            L"topMessage",
135
+            [&](winrt::Microsoft::ReactNative::IJSValueWriter const& eventDataWriter) noexcept {
136
+                eventDataWriter.WriteObjectBegin();
137
+                {
138
+                    WriteProperty(eventDataWriter, L"data", winrt::to_string(args.Value()));
139
+                }
140
+                eventDataWriter.WriteObjectEnd();
141
+            });
142 142
     }
143 143
 
144 144
 } // namespace winrt::ReactNativeWebView::implementation

+ 9
- 9
windows/ReactNativeWebView/ReactWebViewManager.cpp Bestand weergeven

@@ -58,7 +58,6 @@ namespace winrt::ReactNativeWebView::implementation {
58 58
                     auto const& srcMap = propertyValue.AsObject();
59 59
                     if (srcMap.find("uri") != srcMap.end()) {
60 60
                         auto uriString = srcMap.at("uri").AsString();
61
-                        // non-uri sources not yet supported
62 61
                         if (uriString.length() == 0) {
63 62
                             continue;
64 63
                         }
@@ -67,9 +66,9 @@ namespace winrt::ReactNativeWebView::implementation {
67 66
                         if (srcMap.find("__packager_asset") != srcMap.end()) {
68 67
                             isPackagerAsset = srcMap.at("__packager_asset").AsBoolean();
69 68
                         }
70
-
71
-                        if (isPackagerAsset && uriString.find("assets") == 0) {
72
-                            uriString.replace(0, 6, "ms-appx://");
69
+                        if (isPackagerAsset && uriString.find("file://") == 0) {
70
+                            auto bundleRootPath = winrt::to_string(ReactNativeHost().InstanceSettings().BundleRootPath());
71
+                            uriString.replace(0, 7, bundleRootPath.empty() ? "ms-appx-web:///Bundle/" : bundleRootPath);
73 72
                         }
74 73
 
75 74
                         webView.Navigate(winrt::Uri(to_hstring(uriString)));
@@ -94,10 +93,10 @@ namespace winrt::ReactNativeWebView::implementation {
94 93
 
95 94
     ConstantProviderDelegate ReactWebViewManager::ExportedCustomDirectEventTypeConstants() noexcept {
96 95
         return [](winrt::IJSValueWriter const& constantWriter) {
97
-            WriteCustomDirectEventTypeConstant(constantWriter, "onLoadingStart");
98
-            WriteCustomDirectEventTypeConstant(constantWriter, "onLoadingFinish");
99
-            WriteCustomDirectEventTypeConstant(constantWriter, "onLoadingError");
100
-            WriteCustomDirectEventTypeConstant(constantWriter, "onMessage");
96
+            WriteCustomDirectEventTypeConstant(constantWriter, "LoadingStart");
97
+            WriteCustomDirectEventTypeConstant(constantWriter, "LoadingFinish");
98
+            WriteCustomDirectEventTypeConstant(constantWriter, "LoadingError");
99
+            WriteCustomDirectEventTypeConstant(constantWriter, "Message");
101 100
         };
102 101
     }
103 102
 
@@ -116,6 +115,7 @@ namespace winrt::ReactNativeWebView::implementation {
116 115
         FrameworkElement const& view,
117 116
         int64_t commandId,
118 117
         winrt::IJSValueReader const& commandArgsReader) noexcept {
118
+        auto commandArgs = JSValue::ReadArrayFrom(commandArgsReader);
119 119
         if (auto webView = view.try_as<winrt::WebView>()) {
120 120
             switch (commandId) {
121 121
                 case static_cast<int64_t>(WebViewCommands::GoForward) :
@@ -135,7 +135,7 @@ namespace winrt::ReactNativeWebView::implementation {
135 135
                     webView.Stop();
136 136
                     break;
137 137
                 case static_cast<int64_t>(WebViewCommands::InjectJavaScript) :
138
-                    webView.InvokeScriptAsync(L"eval", { commandArgsReader.GetString() });
138
+                    webView.InvokeScriptAsync(L"eval", { winrt::to_hstring(commandArgs[0].AsString()) });
139 139
                     break;
140 140
             }
141 141
         }

+ 5357
- 1499
yarn.lock
Diff onderdrukt omdat het te groot bestand
Bestand weergeven