Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0BBC8191EA for ; Mon, 4 Apr 2016 13:52:26 +0000 (UTC) Received: (qmail 19080 invoked by uid 500); 4 Apr 2016 13:52:25 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 18990 invoked by uid 500); 4 Apr 2016 13:52:25 -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 18870 invoked by uid 99); 4 Apr 2016 13:52:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Apr 2016 13:52:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 88AEE2C1F58 for ; Mon, 4 Apr 2016 13:52:25 +0000 (UTC) Date: Mon, 4 Apr 2016 13:52:25 +0000 (UTC) From: "jcesarmobile (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CB-11012) Loadstart loadstop events do not fire for webview (target = _self) 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-11012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15224154#comment-15224154 ] jcesarmobile edited comment on CB-11012 at 4/4/16 1:51 PM: ----------------------------------------------------------- event listeners shouldn't work if you use _self. When you use _self you are loading the website inside the cordova webview, not the inAppBrowser webview, and then you are replacing all your existing code with the code from the website you load, so when your page finish loading, your code is gone and won't be executed. We should document that events only work when using _blank Are you the one who asked this? http://stackoverflow.com/questions/36038076/execute-script-in-cordova-webview/ was (Author: jcesarmobile): event listeners shouldn't work if you use _self. When you use _self you are loading the website inside the cordova webview, not the inAppBrowser webview, and then you are replacing all your existing code with the code from the website you load, so when your page finish loading, your code is gone and won't be executed. Are you the one who asked this? http://stackoverflow.com/questions/36038076/execute-script-in-cordova-webview/ > 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: Android, Plugin InAppBrowser > Environment: Cordova 6.1.0 > Reporter: Rohan > Priority: Blocker > > 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} > > > {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