cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [17/21] git commit: Updated for AppBundle plugin
Date Thu, 24 Oct 2013 01:55:56 GMT
Updated for AppBundle plugin


Branch: refs/heads/master
Commit: 0ae80c8bef0971ebe4728e63187e430d507f9276
Parents: 9946d32
Author: Andrew Grieve <>
Authored: Tue Oct 22 22:27:37 2013 -0400
Committer: Andrew Grieve <>
Committed: Wed Oct 23 21:55:18 2013 -0400

 AppBundle/ | 47 ++++++++++-------------------------------------
 1 file changed, 10 insertions(+), 37 deletions(-)
diff --git a/AppBundle/ b/AppBundle/
index d1b55e0..4acc9dd 100644
--- a/AppBundle/
+++ b/AppBundle/
@@ -1,23 +1,23 @@
-Enables dynamic rerouting or URLs.
+Enables dynamic rerouting of URLs.
-##AppBundle Uri's
-This plugin allows the use of "app-bundle://" instead of platform specific urls such "file:///android_asset"
-For example, to refer to an index.html file in the "www" folder with an absolute path, you
can use
+# iOS Quirks
-    "app-bundle:///index.html"
+- Top-level navigations to file:/// URLs cannot be remapped while preserving history.back()
functionality (OS bug).
-This will navigate you to "file:///android_asset/www/index.html" on android and similarly
for ios.
+# Android Quirks
-##Custom Uri replacement schemes
-You can add your own url replacements to this plugin as well.
+- Requires Android 3.0 or greater.
+- Cannot remap file:/// URLs when the target file exists on the filesystem (OS bug).
+## Api
     appBundle.addAlias(string matchRegex, string replaceRegex, string replaceString, boolean
redirect, function callback(succeeded){});
-    appBundle.clearAllAliases(function callback(succeeded){});
+    appBundle.setResetUrl(string matchRegex, callback(){});
+    appBundle.injectJsForUrl(string matchRegex, string jsToInject, callback(){});
+    appBundle.clearAllAliases(function callback(){});
 *   matchRegex -> allows you to specify a regex that determines which url's are replaced.
 *   replaceRegex -> allows you to specify what part of the url's are replaced.
@@ -41,30 +41,3 @@ The algorithm operates as follows
     continue loading 'url'
-Map http requests to file
-    appBundle.addAlias("^http://mysite\.com/.*", "^http://mysite\.com/", "file://storage_card/",
false, function(succeded){});
-Map http requests to another http location, or file to file
-    appBundle.addAlias("^http://mysite\.com/.*", "^http://mysite\.com/", "http:///",
false, function(succeded){});
-Map http requests to your bundle
-    appBundle.addAlias("^http://mysite\.com/.*", "^http://mysite\.com/", "app-bundle:///",
false, function(succeded){});
-Map bundle requests to http or file. Note the usage of the "{BUNDLE_WWW}" param here. This
is replaced by "file:///android_asset/" on android and similarly on ios.
-Why use "BUNDLE_WWW" and not "app-bundle:///"? "app-bundle:" uri's always point to your bundle
and CANNOT be redirected. Also other parts of your program may make requests to to "file://android_assets/www"
directly (which many plugins actually do). You would expect all requests to get redirected.
The "BUNDLE_WWW" takes care of this.
-    appBundle.addAlias("^{BUNDLE_WWW}.*", "^{BUNDLE_WWW}", "http://mysite\.com", false, function(succeded){});
-Apply recursive replacements. A request to should give http:///
as the recursive replacements apply the rules last to first.
-    appBundle.addAlias("^http://mysite\.com/.*", "^http://mysite\.com/", "{BUNDLE_WWW}",
false, function(succeded){});
-    appBundle.addAlias("^{BUNDLE_WWW}.*", "^{BUNDLE_WWW}", "file://storage/www/", false,
-    appBundle.addAlias("^http://mysite\.com/.*", "^http://mysite\.com/", "http:///",
false, function(succeded){});
-    appBundle.addAlias("^http:///mysiteproxy\.com/.*", "^http:///mysiteproxy\.com/", "http:///",
false, function(succeded){});

View raw message