incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject ios commit: Fixes CB-914 - Deactivate CDVLocalStorage (Backup/Restore, safari web preferences update)
Date Mon, 25 Jun 2012 22:56:33 GMT
Updated Branches:
  refs/heads/master 61aa837bd -> 50c1c4ceb


Fixes CB-914 - Deactivate CDVLocalStorage (Backup/Restore, safari web preferences update)


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

Branch: refs/heads/master
Commit: 50c1c4cebb667c4a2afe960eea62f1cf303f564e
Parents: 61aa837
Author: Shazron Abdullah <shazron@apache.org>
Authored: Mon Jun 25 15:56:26 2012 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Mon Jun 25 15:56:26 2012 -0700

----------------------------------------------------------------------
 Cordova-based Application/Cordova.plist |    2 ++
 CordovaLib/Classes/CDVViewController.m  |   13 +++++++++++--
 CordovaLib/CordovaLibApp/Cordova.plist  |    2 ++
 guides/Cordova Settings File.md         |    4 ++++
 guides/Cordova Upgrade Guide.md         |    5 +++++
 5 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/50c1c4ce/Cordova-based Application/Cordova.plist
----------------------------------------------------------------------
diff --git a/Cordova-based Application/Cordova.plist b/Cordova-based Application/Cordova.plist
index 771caac..7d1fbdf 100644
--- a/Cordova-based Application/Cordova.plist	
+++ b/Cordova-based Application/Cordova.plist	
@@ -40,6 +40,8 @@
 	<false/>
 	<key>OpenAllWhitelistURLsInWebView</key>
 	<false/>
+	<key>BackupWebStorage</key>
+	<true/>
 	<key>ExternalHosts</key>
 	<array/>
 	<key>Plugins</key>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/50c1c4ce/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 4c36587..2b78291 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -171,7 +171,14 @@
     
     //// Fix the iOS 5.1 SECURITY_ERR bug (CB-347), this must be before the webView is instantiated
////
 
-    [CDVLocalStorage __verifyAndFixDatabaseLocations];
+    BOOL backupWebStorage = YES;  // default value
+    if ([self.settings objectForKey:@"BackupWebStorage"]) {
+        backupWebStorage = [(NSNumber*)[settings objectForKey:@"BackupWebStorage"] boolValue];
+    }
+    
+    if (backupWebStorage) {
+        [CDVLocalStorage __verifyAndFixDatabaseLocations];
+    }
     
     //// Instantiate the WebView ///////////////
 
@@ -200,7 +207,9 @@
     /*
      * Fire up CDVLocalStorage to work-around iOS 5.1 WebKit storage limitations
      */
-    [self.commandDelegate registerPlugin:[[[CDVLocalStorage alloc] initWithWebView:self.webView]
autorelease] withClassName:NSStringFromClass([CDVLocalStorage class])];
+    if (backupWebStorage) {
+        [self.commandDelegate registerPlugin:[[[CDVLocalStorage alloc] initWithWebView:self.webView]
autorelease] withClassName:NSStringFromClass([CDVLocalStorage class])];
+    }
     
     /*
      * This is for iOS 4.x, where you can allow inline <video> and <audio>, and
also autoplay them

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/50c1c4ce/CordovaLib/CordovaLibApp/Cordova.plist
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLibApp/Cordova.plist b/CordovaLib/CordovaLibApp/Cordova.plist
index 771caac..7d1fbdf 100644
--- a/CordovaLib/CordovaLibApp/Cordova.plist
+++ b/CordovaLib/CordovaLibApp/Cordova.plist
@@ -40,6 +40,8 @@
 	<false/>
 	<key>OpenAllWhitelistURLsInWebView</key>
 	<false/>
+	<key>BackupWebStorage</key>
+	<true/>
 	<key>ExternalHosts</key>
 	<array/>
 	<key>Plugins</key>

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/50c1c4ce/guides/Cordova
Settings File.md
----------------------------------------------------------------------
diff --git a/guides/Cordova Settings File.md b/guides/Cordova Settings File.md
index 69a4f2a..3c0ebc0 100644
--- a/guides/Cordova Settings File.md	
+++ b/guides/Cordova Settings File.md	
@@ -43,3 +43,7 @@ The **Cordova.plist settings file** controls various settings of Cordova.
This i
 	h. **AllowInlineMediaPlayback (boolean, defaults to NO)** - set to YES to allow inline HTML5
media playback, also, the video element in the HTML document must also include the webkit-playsinline
attribute
 	
 	i. **OpenAllWhitelistURLsInWebView (boolean, defaults to NO)** - set to YES to open all
white-listed URLs in the main WebView
+
+	j. **BackupWebStorage (boolean, defaults to YES)** - set to NO to prevent the backup of
localStorage and WebSQL databases to the Documents/Backups folder. This was a fix for this
[Apple bug](http://phonegap.com/2012/04/18/ios-5-1-and-the-embedded-uiwebview-with-cordova/)
+
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/50c1c4ce/guides/Cordova
Upgrade Guide.md
----------------------------------------------------------------------
diff --git a/guides/Cordova Upgrade Guide.md b/guides/Cordova Upgrade Guide.md
index 5b64efd..33df4d7 100644
--- a/guides/Cordova Upgrade Guide.md	
+++ b/guides/Cordova Upgrade Guide.md	
@@ -42,6 +42,11 @@ This document is for developers who need to upgrade their Cordova-based
projects
 3. **Copy** the **www/cordova-1.9.0.js** file from the new project into your **www** folder,
and delete your **www/cordova-1.8.x.js** file
 4. **Update** the Cordova script reference in your **www/index.html** file (and any other
files that contain the script reference) to point to the new **cordova-1.9.0.js** file
 
+**Note:**
+
+1.9.0 supports the new **"BackupWebStorage"** boolean setting in Cordova.plist. By default,
this setting is turned on, set it to "false" to turn it off - especially for iOS 6 - see [Release
Notes - Safari and UIKit Section](https://developer.apple.com/library/prerelease/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html)
+
+
 ## Upgrading Cordova 1.7.0 projects to 1.8.x ##
 
 1. **Install** Cordova 1.8.0


Mime
View raw message