InAppBrowser.java: New method isURLWhileListed to check for whitelisting of

"AllowedSchemes" in a new preference configuration item.
There is a new check in shouldOverrideUrlLoading, to allow whitelisted
custom schemes like "mycoolapp://"

inappbrowser.js: Added "customscheme" channel.
This commit is contained in:
stevepodell 2018-04-05 10:14:54 -07:00
parent 2d69afcd7c
commit 019ec3963f

View File

@ -1111,7 +1111,7 @@ public class InAppBrowser extends CordovaPlugin {
LOG.e(LOG_TAG, "Error sending sms " + url + ":" + e.toString());
}
}
// Test for whitelisted custom scheme names, less than 20 chars long, like mycoolapp: or twitteroauthresponse: (Twitter Oauth Response)
// Test for whitelisted custom scheme names, less than 20 chars long, like mycoolapp:// or twitteroauthresponse:// (Twitter Oauth Response)
else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^[a-z]{0,20}://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes", "");