From issues-return-97704-archive-asf-public=cust-asf.ponee.io@cordova.apache.org Tue Nov 13 16:13:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 13D8718062B for ; Tue, 13 Nov 2018 16:13:04 +0100 (CET) Received: (qmail 65024 invoked by uid 500); 13 Nov 2018 15:13:04 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 65010 invoked by uid 99); 13 Nov 2018 15:13:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2018 15:13:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 92072C1696 for ; Tue, 13 Nov 2018 15:13:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id HzxGA3khDMkl for ; Tue, 13 Nov 2018 15:13:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 36C816239F for ; Tue, 13 Nov 2018 15:13:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 6E9CAE02E3 for ; Tue, 13 Nov 2018 15:13:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 356A92525D for ; Tue, 13 Nov 2018 15:13:00 +0000 (UTC) Date: Tue, 13 Nov 2018 15:13:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-14188) Callback to decide whether to open link or not. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-14188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16685351#comment-16685351 ] 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 URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/276#discussion_r233077431 ########## File path: src/android/InAppBrowser.java ########## @@ -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: users@infra.apache.org > Callback to decide whether to open link or not. > ----------------------------------------------- > > Key: CB-14188 > URL: https://issues.apache.org/jira/browse/CB-14188 > 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 (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org