cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-14188) Callback to decide whether to open link or not.
Date Tue, 13 Nov 2018 15:13:00 GMT


ASF GitHub Bot commented on CB-14188:

wvengen commented on a change in pull request #276: CB-14188: Add beforeload event, catching
navigation before it happens

 File path: src/android/
 @@ -1085,16 +1105,20 @@ public void onActivityResult(int requestCode, int resultCode, Intent
intent) {
     public class InAppBrowserClient extends WebViewClient {
         EditText edittext;
         CordovaWebView webView;
+        boolean useBeforeload;
+        boolean waitForBeforeload;
          * Constructor.
          * @param webView
          * @param mEditText
-        public InAppBrowserClient(CordovaWebView webView, EditText mEditText) {
+        public InAppBrowserClient(CordovaWebView webView, EditText mEditText, boolean useBeforeload)
             this.webView = webView;
             this.edittext = mEditText;
+            this.useBeforeload = useBeforeload;
 Review comment:
   (this is merged already, but perhaps my reply will serve as a reference)
   `waitForBeforeload` is the current state, whether we need to wait a call back from JS to
really load next time it is encountered. `useBeforeload` indicates whether the `beforeload`
event is used at all (see the end of `shouldOverrideUrlLoading`).

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Callback to decide whether to open link or not.
> -----------------------------------------------
>                 Key: CB-14188
>                 URL:
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: cordova-plugin-inappbrowser
>    Affects Versions: 3.0.0
>            Reporter: wvengen
>            Priority: Major
> Several times I've found myself wanting to tell inAppBrowser whether it can open a link
in the embedded webview or using the system web browser. It would be great if there's a callback
_before_ loading a page (loadstart is too late there), where I can tell inAppBrowser to load
the page or not.
> CB-14013 introduced AllowedSchemes, but excluded the use of http and https. -It would
be useful to allow intercepting http and https links, e.g. to decide whether to open the link
in the system web browser or not.- At first I thought this mechanism could be used, but because
of the asynchronous nature of Cordova callbacks, this didn't work out, and I added a beforeload
callback. See comment for an example.
> I've submitted a PR -(my approach would be to generate a regexp based on AllowedSchemes
and match the URL on that, instead of the current if logic)-.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message