White list support. Pull request https://github.com/phonegap/phonegap-android/pull/211 from imhotep would not merge, so combined it with enhancements for this commit.

This commit is contained in:
Bryce Curtis
2011-09-26 10:58:41 -05:00
parent bb777c096c
commit 80df4a8fb2
4 changed files with 119 additions and 2 deletions
+10
View File
@@ -79,6 +79,16 @@ App.prototype.exitApp = function() {
return PhoneGap.exec(null, null, "App", "exitApp", []);
};
/**
* Add entry to approved list of URLs (whitelist) that will be loaded into PhoneGap container instead of default browser.
*
* @param origin URL regular expression to allow
* @param subdomains T=include all subdomains under origin
*/
App.prototype.addWhiteListEntry = function(origin, subdomains) {
return PhoneGap.exec(null, null, "App", "addWhiteListEntry", [origin, subdomains]);
};
PhoneGap.addConstructor(function() {
navigator.app = new App();
});