Browse Source

Merge branch 'master' into android-download-try-catch

Jamon Holmgren 4 years ago
parent
commit
407db11fb1
No account linked to committer's email address

+ 5
- 11
.github/workflows/windows-ci.yml View File

15
       with:
15
       with:
16
         node-version: '12.9.1'
16
         node-version: '12.9.1'
17
 
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
18
     - name: Setup MSBuild
23
       uses: microsoft/setup-msbuild@v1.0.0
19
       uses: microsoft/setup-msbuild@v1.0.0
24
       with:
20
       with:
25
         vs-version: 16.5
21
         vs-version: 16.5
26
-       
27
-    - name: Setup NuGet
28
-      uses: NuGet/setup-nuget@v1.0.2
29
 
22
 
30
     - name: Check node modules cache
23
     - name: Check node modules cache
31
       uses: actions/cache@v1
24
       uses: actions/cache@v1
45
       run: |
38
       run: |
46
         yarn build
39
         yarn build
47
         yarn tsc
40
         yarn tsc
48
- 
49
-    - name: NuGet restore
50
-      run: nuget restore example\windows\WebViewWindows.sln
51
 
41
 
52
     - name: Build x64 release
42
     - name: Build x64 release
53
-      run: msbuild example\windows\WebViewWindows.sln /p:Configuration=Release /p:Platform=x64 -m
43
+      shell: powershell
44
+      run: npx react-native run-windows --root example --arch x64 --release --no-packager --no-deploy --logging
54
 
45
 
46
+    # Workaround for a bug in package searching during deploy.
47
+    # The deploy script only searches windows/{*/bin/x64/Release,Release/*}, but the build step above placed the pakcages at windows/x64/Release.
48
+    # Copy the packages to Windows/Release before deploying.
55
     - name: Deploy
49
     - name: Deploy
56
       shell: powershell
50
       shell: powershell
57
       run: |
51
       run: |

+ 9
- 4
android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java View File

437
 
437
 
438
   @ReactProp(name = "incognito")
438
   @ReactProp(name = "incognito")
439
   public void setIncognito(WebView view, boolean enabled) {
439
   public void setIncognito(WebView view, boolean enabled) {
440
+    // Don't do anything when incognito is disabled
441
+    if (!enabled) {
442
+      return;
443
+    }
444
+
440
     // Remove all previous cookies
445
     // Remove all previous cookies
441
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
446
     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
442
       CookieManager.getInstance().removeAllCookies(null);
447
       CookieManager.getInstance().removeAllCookies(null);
446
 
451
 
447
     // Disable caching
452
     // Disable caching
448
     view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
453
     view.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
449
-    view.getSettings().setAppCacheEnabled(!enabled);
454
+    view.getSettings().setAppCacheEnabled(false);
450
     view.clearHistory();
455
     view.clearHistory();
451
-    view.clearCache(enabled);
456
+    view.clearCache(true);
452
 
457
 
453
     // No form data or autofill enabled
458
     // No form data or autofill enabled
454
     view.clearFormData();
459
     view.clearFormData();
455
-    view.getSettings().setSavePassword(!enabled);
456
-    view.getSettings().setSaveFormData(!enabled);
460
+    view.getSettings().setSavePassword(false);
461
+    view.getSettings().setSaveFormData(false);
457
   }
462
   }
458
 
463
 
459
   @ReactProp(name = "source")
464
   @ReactProp(name = "source")

+ 1
- 1
apple/RNCWebView.m View File

878
  */
878
  */
879
 -(UIViewController *)topViewControllerWithRootViewController:(UIViewController *)viewController{
879
 -(UIViewController *)topViewControllerWithRootViewController:(UIViewController *)viewController{
880
   if (viewController==nil) return nil;
880
   if (viewController==nil) return nil;
881
-  if (viewController.presentedViewController!=nil) {
881
+  if (viewController.presentedViewController!=nil && viewController.presentedViewController.isBeingPresented) {
882
     return [self topViewControllerWithRootViewController:viewController.presentedViewController];
882
     return [self topViewControllerWithRootViewController:viewController.presentedViewController];
883
   } else if ([viewController isKindOfClass:[UITabBarController class]]){
883
   } else if ([viewController isKindOfClass:[UITabBarController class]]){
884
     return [self topViewControllerWithRootViewController:[(UITabBarController *)viewController selectedViewController]];
884
     return [self topViewControllerWithRootViewController:[(UITabBarController *)viewController selectedViewController]];

+ 2
- 0
metro.config.windows.js View File

35
       new RegExp(
35
       new RegExp(
36
         `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
36
         `${path.resolve(__dirname, 'windows').replace(/[/\\]/g, '/')}.*`,
37
       ),
37
       ),
38
+      // Avoid error EBUSY: resource busy or locked, open '...\vnext\msbuild.ProjectImports.zip' when building 'vnext\Microsoft.ReactNative.sln' with '/bl'
39
+      /.*\.ProjectImports\.zip/,
38
     ]),
40
     ]),
39
   },
41
   },
40
   transformer: {
42
   transformer: {

+ 1
- 1
package.json View File

8
     "Thibault Malbranche <malbranche.thibault@gmail.com>"
8
     "Thibault Malbranche <malbranche.thibault@gmail.com>"
9
   ],
9
   ],
10
   "license": "MIT",
10
   "license": "MIT",
11
-  "version": "10.4.0",
11
+  "version": "10.4.1",
12
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
12
   "homepage": "https://github.com/react-native-community/react-native-webview#readme",
13
   "scripts": {
13
   "scripts": {
14
     "start": "node node_modules/react-native/local-cli/cli.js start",
14
     "start": "node node_modules/react-native/local-cli/cli.js start",