You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2015/09/14 17:13:59 UTC

[1/3] ios commit: CB-9636 - only load a WebView engine if the url to load passes the engine's canLoadRequest filter

Repository: cordova-ios
Updated Branches:
  refs/heads/CB-9328 3663e6ac6 -> d050f499a (forced update)


CB-9636 - only load a WebView engine if the url to load passes the engine's canLoadRequest filter


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/a56ff479
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/a56ff479
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/a56ff479

Branch: refs/heads/CB-9328
Commit: a56ff479fcd9053e141ef4bb3779491987b49bc4
Parents: 0f571e3
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Sep 11 01:22:09 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Sep 11 01:22:35 2015 -0700

----------------------------------------------------------------------
 .../Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m     | 5 +++++
 CordovaLib/Classes/Public/CDVViewController.m                   | 4 ++--
 CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h            | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a56ff479/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m b/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m
index 57df822..ef0356c 100644
--- a/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m
+++ b/CordovaLib/Classes/Private/Plugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m
@@ -91,6 +91,11 @@
     return [[(UIWebView*)_engineWebView request] URL];
 }
 
+- (BOOL) canLoadRequest:(NSURLRequest*)request
+{
+    return (request != nil);
+}
+
 - (void)updateSettings:(NSDictionary*)settings
 {
     UIWebView* uiWebView = (UIWebView*)_engineWebView;

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a56ff479/CordovaLib/Classes/Public/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVViewController.m b/CordovaLib/Classes/Public/CDVViewController.m
index 830e3ed..299fb6c 100644
--- a/CordovaLib/Classes/Public/CDVViewController.m
+++ b/CordovaLib/Classes/Public/CDVViewController.m
@@ -395,8 +395,8 @@
     // Find webViewEngine
     if (NSClassFromString(webViewEngineClass)) {
         self.webViewEngine = [[NSClassFromString(webViewEngineClass) alloc] initWithFrame:bounds];
-        // if a webView engine returns nil (not supported by the current iOS version) or doesn't conform to the protocol, we use UIWebView
-        if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)]) {
+        // if a webView engine returns nil (not supported by the current iOS version) or doesn't conform to the protocol, or can't load the request, we use UIWebView
+        if (!self.webViewEngine || ![self.webViewEngine conformsToProtocol:@protocol(CDVWebViewEngineProtocol)] || ![self.webViewEngine canLoadRequest:[NSURLRequest requestWithURL:self.appUrl]]) {
             self.webViewEngine = [[NSClassFromString(defaultWebViewEngineClass) alloc] initWithFrame:bounds];
         }
     } else {

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a56ff479/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h b/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
index 18c1831..34d07f3 100644
--- a/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
+++ b/CordovaLib/Classes/Public/CDVWebViewEngineProtocol.h
@@ -34,6 +34,7 @@
 - (void)evaluateJavaScript:(NSString*)javaScriptString completionHandler:(void (^)(id, NSError*))completionHandler;
 
 - (NSURL*)URL;
+- (BOOL)canLoadRequest:(NSURLRequest*)request;
 
 - (instancetype)initWithFrame:(CGRect)frame;
 - (void)updateWithInfo:(NSDictionary*)info;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/3] ios commit: CB-9328 Use ios-sim as a node module, not a CLI utility

Posted by ma...@apache.org.
CB-9328 Use ios-sim as a node module, not a CLI utility


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/d050f499
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/d050f499
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/d050f499

Branch: refs/heads/CB-9328
Commit: d050f499a355052613ae1a165e548a435dcdeacc
Parents: 47154c3
Author: Simon MacDonald <si...@gmail.com>
Authored: Wed Sep 9 00:00:09 2015 -0400
Committer: Simon MacDonald <si...@gmail.com>
Committed: Mon Sep 14 11:10:09 2015 -0400

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/run.js | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/d050f499/bin/templates/scripts/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/run.js b/bin/templates/scripts/cordova/lib/run.js
index 3e4c0ac..f1efbf2 100644
--- a/bin/templates/scripts/cordova/lib/run.js
+++ b/bin/templates/scripts/cordova/lib/run.js
@@ -20,10 +20,11 @@
 /*jshint node: true*/
 
 var Q = require('q'),
-    nopt  = require('nopt'),
-    path  = require('path'),
-    build = require('./build'),
-    spawn = require('./spawn'),
+    nopt   = require('nopt'),
+    path   = require('path'),
+    iossim = require('ios-sim'),
+    build  = require('./build'),
+    spawn  = require('./spawn'),
     check_reqs = require('./check_reqs');
 
 var cordovaPath = path.join(__dirname, '..');
@@ -168,13 +169,8 @@ function deployToSim(appPath, target) {
 
 function startSim(appPath, target) {
     var logPath = path.join(cordovaPath, 'console.log');
-    var simArgs = ['launch', appPath,
-        '--devicetypeid', 'com.apple.CoreSimulator.SimDeviceType.' + target,
-        // We need to redirect simulator output here to use cordova/log command
-        // TODO: Is there any other way to get emulator's output to use in log command?
-        '--stderr', logPath, '--stdout', logPath,
-        '--exit'];
-    return spawn('ios-sim', simArgs);
+
+    return iossim.launch(appPath, 'com.apple.CoreSimulator.SimDeviceType.' + target, logPath, "--exit");
 }
 
 function listDevices() {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/3] ios commit: CB-9254 - update_cordova_subproject command for cordova-ios 4.0.0-dev results in a build error

Posted by ma...@apache.org.
CB-9254 - update_cordova_subproject command for cordova-ios 4.0.0-dev results in a build error


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/47154c3c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/47154c3c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/47154c3c

Branch: refs/heads/CB-9328
Commit: 47154c3c366aa9fa423639eb002966f5666f5e8b
Parents: a56ff47
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Sep 11 17:23:32 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Sep 11 17:23:32 2015 -0700

----------------------------------------------------------------------
 bin/update_cordova_subproject     | 31 -------------------------------
 bin/update_cordova_subproject.bat | 26 --------------------------
 2 files changed, 57 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/47154c3c/bin/update_cordova_subproject
----------------------------------------------------------------------
diff --git a/bin/update_cordova_subproject b/bin/update_cordova_subproject
deleted file mode 100755
index 88e933e..0000000
--- a/bin/update_cordova_subproject
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env node
-
-/*
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements. See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership. The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License. You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied. See the License for the
-    specific language governing permissions and limitations
-    under the License.
-*/
-
-var create = require('./lib/create'),
-    args;
-
-if (process.argv.length < 3) {
-    create.updateSubprojectHelp();
-}
-else {
-    args = process.argv.slice(2);
-    create.update_cordova_subproject(args);
-}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/47154c3c/bin/update_cordova_subproject.bat
----------------------------------------------------------------------
diff --git a/bin/update_cordova_subproject.bat b/bin/update_cordova_subproject.bat
deleted file mode 100644
index 1f1c1c9..0000000
--- a/bin/update_cordova_subproject.bat
+++ /dev/null
@@ -1,26 +0,0 @@
-:: Licensed to the Apache Software Foundation (ASF) under one
-:: or more contributor license agreements. See the NOTICE file
-:: distributed with this work for additional information
-:: regarding copyright ownership. The ASF licenses this file
-:: to you under the Apache License, Version 2.0 (the
-:: "License"); you may not use this file except in compliance
-:: with the License. You may obtain a copy of the License at
-::
-:: http://www.apache.org/licenses/LICENSE-2.0
-::
-:: Unless required by applicable law or agreed to in writing,
-:: software distributed under the License is distributed on an
-:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-:: KIND, either express or implied. See the License for the
-:: specific language governing permissions and limitations
-:: under the License.
-
-@ECHO OFF
-SET script="%~dp0update_cordova_subproject"
-IF EXIST %script% (
-    node %script% %*
-) ELSE (
-    ECHO.
-    ECHO ERROR: Could not find 'update_cordova_subproject' script in 'bin' folder, aborting...>&2
-    EXIT /B 1
-)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org