cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-11012) Loadstart loadstop events do not fire for webview (target = _self)
Date Wed, 06 Apr 2016 15:53:25 GMT

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

David edited comment on CB-11012 at 4/6/16 3:52 PM:
----------------------------------------------------

I'm using "_blank" within my ionic2 app but the events still won't fire:
{code}
    var url = 'http://myURL.com';
    var browserRef = cordova.InAppBrowser.open(url, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');
    browserRef.addEventListener('loadstart', event => {
      console.log('loadstart event'); // not fired
    });
    browserRef.addEventListener('exit', event => {
      console.log('exit event'); // not fired
    });
{code}



was (Author: flavordaaave):
I'm using `_blank` within my ionic2 app but the events still won't fire:
```
    var url = 'http://myURL.com';
    var browserRef = cordova.InAppBrowser.open(url, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes');
    browserRef.addEventListener('loadstart', event => {
      console.log('loadstart event'); // not fired
    });
    browserRef.addEventListener('exit', event => {
      console.log('exit event'); // not fired
    });
```

> Loadstart loadstop events do not fire for webview (target = _self)
> ------------------------------------------------------------------
>
>                 Key: CB-11012
>                 URL: https://issues.apache.org/jira/browse/CB-11012
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Docs, Plugin InAppBrowser
>         Environment: Cordova 6.1.0
>            Reporter: Rohan
>            Priority: Minor
>              Labels: triaged
>
> Building a cordova app using Ionic.
> Loading a URL in webview using inappbrowser plugin but none of the events like loadstart,
loadstop  get fired.
> This is my app.js
> {code}
>  var ref = cordova.InAppBrowser.open('http://www.google.com','_self', 'location=no')
>           ref.addEventListener('loadstart', function (event) {
>             console.log('loadstart fired');
>           }, false);
>           ref.addEventListener('loadstop', function (event) {
>             console.log('loadstop fired');
>           }, false);
>           ref.addEventListener('loaderror', function (event) {
>             console.log('loadstop fired');
>           }, false);
>           ref.addEventListener('exit', function (event) {
>             console.log('exit fired');
>           }, false);
> {code}
> CSP in index.html
> {code}
>  
>    <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap:
https://ssl.gstatic.com; style-src 'self' 'unsafe-inline'; media-src *">
> {code}
>  Console output is blank when _self is used
> *Note: The events fire when target _blank is used.*
> {code}
> I/chromium( 2222): [INFO:CONSOLE(69)] "loadstart fired", source: file:///android_asset/www/src/app.js
(69)
> I/chromium( 2222): [INFO:CONSOLE(73)] "loadstop fired", source: file:///android_asset/www/src/app.js
(73) 
> I/chromium( 2222): [INFO:CONSOLE(73)] "loadstop fired", source: file:///android_asset/www/src/app.js
(73)
> I/chromium( 2722): [INFO:library_loader_hooks.cc(130)] Chromium logging enabled: level
= 0, default verbosity = 0
> I/chromium( 2222): [INFO:CONSOLE(73)] "loadstop fired", source: file:///android_asset/www/src/app.js
(73)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message