Skip to content

Commit fd3118b

Browse files
committed
[HGNN-7768] add 'customscheme' event to block landing store from in-app browser page
1 parent 0178a4f commit fd3118b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/android/InAppBrowser.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,8 +1457,14 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^
14571457
LOG.d(LOG_TAG, "execute deeplink [" + url + "]");
14581458
try {
14591459
cordova.getActivity().startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
1460+
JSONObject obj = new JSONObject();
1461+
obj.put("type", "customscheme");
1462+
obj.put("url", url);
1463+
sendUpdate(obj, true);
14601464
} catch (ActivityNotFoundException e) {
14611465
LOG.e(LOG_TAG, "not installed deeplink app [" + url + "] : " + e.toString());
1466+
} catch (JSONException ex) {
1467+
LOG.e(LOG_TAG, "Custom Scheme URI passed in has caused a JSON error.");
14621468
}
14631469
override = true;
14641470
break;
@@ -1468,7 +1474,7 @@ else if (!url.startsWith("http:") && !url.startsWith("https:") && url.matches("^
14681474
LOG.e(LOG_TAG, "not allowed this scheme [" + url + "]");
14691475
}
14701476
} catch (NullPointerException e) {
1471-
LOG.e(LOG_TAG, "null exception?! : " + e.toString());
1477+
LOG.e(LOG_TAG, "scheme is null?! : " + e.toString());
14721478
}
14731479
} else {
14741480
LOG.e(LOG_TAG, "no allowedSchemes");

0 commit comments

Comments
 (0)