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

wvengen commented on CB-14188:
------------------------------

I've experimented with adding a beforeload event on Android, where I hoped to 
return in a callback whether to load the page or not. But I found no support 
for return values with callbacks in Cordova. So if there is to be a beforeload 
event, the WebView needs to deny all url loads, except when initiated from the 
beforeload handler (with a sensible default behaviour when there is no event 
handler).

This could be done by adding an inAppBrowser option to _not_ load URLs, unless 
explicitely requested from the beforeload handler. Then either we track whether 
the loading originated from the beforeload handler (I guess that may be 
tricky), or the inAppBrowser has a specific method to 'really' load a URL 
(bypassing beforeload handlers). Perhaps this method could be passed as an 
argument to the beforeload handler, so that it is only used there.

> Allow http and https for AllowedSchemes
> ---------------------------------------
>
>                 Key: CB-14188
>                 URL: https://issues.apache.org/jira/browse/CB-14188
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: cordova-plugin-inappbrowser
>    Affects Versions: 3.0.0
>            Reporter: wvengen
>            Priority: Major
>
> 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.
> I'd be happy to submit 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to