mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Remove addWhiteList from public API
This commit is contained in:
parent
853a734f82
commit
e02322b66b
@ -95,16 +95,6 @@ App.prototype.exitApp = function() {
|
|||||||
return PhoneGap.exec(null, null, "App", "exitApp", []);
|
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() {
|
PhoneGap.addConstructor(function() {
|
||||||
navigator.app = new App();
|
navigator.app = new App();
|
||||||
});
|
});
|
||||||
|
@ -70,9 +70,6 @@ public class App extends Plugin {
|
|||||||
else if (action.equals("exitApp")) {
|
else if (action.equals("exitApp")) {
|
||||||
this.exitApp();
|
this.exitApp();
|
||||||
}
|
}
|
||||||
else if (action.equals("addWhiteListEntry")) {
|
|
||||||
this.addWhiteListEntry(args.getString(0), args.optBoolean(1));
|
|
||||||
}
|
|
||||||
return new PluginResult(status, result);
|
return new PluginResult(status, result);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
|
return new PluginResult(PluginResult.Status.JSON_EXCEPTION);
|
||||||
@ -198,14 +195,4 @@ public class App extends Plugin {
|
|||||||
public void exitApp() {
|
public void exitApp() {
|
||||||
((DroidGap)this.ctx).endActivity();
|
((DroidGap)this.ctx).endActivity();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add entry to approved list of URLs (whitelist)
|
|
||||||
*
|
|
||||||
* @param origin URL regular expression to allow
|
|
||||||
* @param subdomains T=include all subdomains under origin
|
|
||||||
*/
|
|
||||||
public void addWhiteListEntry(String origin, boolean subdomains) {
|
|
||||||
((DroidGap)this.ctx).addWhiteListEntry(origin, subdomains);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1767,7 +1767,7 @@ public class DroidGap extends PhonegapActivity {
|
|||||||
* @param origin URL regular expression to allow
|
* @param origin URL regular expression to allow
|
||||||
* @param subdomains T=include all subdomains under origin
|
* @param subdomains T=include all subdomains under origin
|
||||||
*/
|
*/
|
||||||
public void addWhiteListEntry(String origin, boolean subdomains) {
|
private void addWhiteListEntry(String origin, boolean subdomains) {
|
||||||
try {
|
try {
|
||||||
// Unlimited access to network resources
|
// Unlimited access to network resources
|
||||||
if(origin.compareTo("*") == 0) {
|
if(origin.compareTo("*") == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user