[ 
https://issues.apache.org/jira/browse/CB-14188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16545026#comment-16545026
 ] 

ASF GitHub Bot commented on CB-14188:
-------------------------------------

wvengen opened a new pull request #276: CB-14188: add beforeload event, 
catching navigation before it happens
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/276
 
 
   <!--
   Please make sure the checklist boxes are all checked before submitting the 
PR. The checklist
   is intended as a quick reference, for complete details please see our 
Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   
   Android, iOS
   
   ### What does this PR do?
   
   Implements [CB-14811](https://issues.apache.org/jira/browse/CB-14188): 
support for a callback that determines whether a URL to be loaded in the 
inAppBrowser should be loaded or not.
   
   ### What testing has been done on this change?
   
   On iOS & Android emulators (will test on real devices soon).
   
   ### Checklist
   - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
   - [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform 
affected.
   - [ ] Added automated test coverage as appropriate for this change: if 
anyone wants to add it, feel free, but as not all features like this have 
automated tests, it doesn't look like this is always required. If it does 
qualify for automated tests, please let me know, and I'll look into it.
   - [x] Added documentation for this change (added checklist item)
   

----------------------------------------------------------------
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:
[email protected]


> 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 plan to submit a PR soonish -(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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to