Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F302ECF0 for ; Wed, 30 Jan 2013 18:15:09 +0000 (UTC) Received: (qmail 15934 invoked by uid 500); 30 Jan 2013 18:15:09 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 15909 invoked by uid 500); 30 Jan 2013 18:15:09 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 15900 invoked by uid 99); 30 Jan 2013 18:15:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2013 18:15:09 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of fil@adobe.com designates 64.18.1.23 as permitted sender) Received: from [64.18.1.23] (HELO exprod6og109.obsmtp.com) (64.18.1.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jan 2013 18:15:02 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob109.postini.com ([64.18.5.12]) with SMTP ID DSNKUQljEJgVK5rtS6OLOnmxvjmdXhUditfz@postini.com; Wed, 30 Jan 2013 10:14:42 PST Received: from inner-relay-4.eur.adobe.com (inner-relay-4b [10.128.4.237]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r0UIEeC9004808 for ; Wed, 30 Jan 2013 10:14:40 -0800 (PST) Received: from nahub01.corp.adobe.com (nahub01.corp.adobe.com [10.8.189.97]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id r0UIEZXN009627 for ; Wed, 30 Jan 2013 10:14:39 -0800 (PST) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nahub01.corp.adobe.com ([10.8.189.97]) with mapi; Wed, 30 Jan 2013 10:14:37 -0800 From: Filip Maj To: "dev@cordova.apache.org" Date: Wed, 30 Jan 2013 10:18:07 -0800 Subject: Re: Global Javascript in InAppBrowser Thread-Topic: Global Javascript in InAppBrowser Thread-Index: Ac3/FalIocrVekHYTf2VXW+S9BsM5A== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.5.121010 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Is there any way we can formalize this behavior in a native (or native + JS) test (for any platform)? On 1/30/13 10:11 AM, "Shazron" wrote: >"Right now it seems every call to window.open is going to give you a new >instance" --> on iOS it is re-used. > >I suppose we could handle those implied handlers, those are just >JavaScript >changes I believe > >On Tue, Jan 29, 2013 at 10:40 PM, Jesse wrote: > >> The original interface was simply to allow the host code to monitor >> location changes. This allows for oauth workflows. >> Data can(?) be passed back and forth via a query string param *afaik*. >> Supporting window.opener is full of blockers, not just async issues, but >> also security. >> >> I think the inappbrowser instance 'should' support having it's location >> changed by the host app, this was there in the original ChildBrowser. >> Right now it seems every call to window.open is going to give you a new >> instance, when what you probably want to do in some cases is to re-use >>it. >> >> If we are evaluating this API, I also think we need to support the >> 'implied' apis >> ex. var ref =3D window.open(...) >> >> Currently we support ref.addEventListener, ref.removeEventListener, >> (loadstart, loadstop, exit) >> but not the implied: >> ref.onloadstart, ref.onloadstop, ref.onexit >> and also, we should possibly support >> ref.addEventListener("loadstart",{ handleEvent:function(evt) { } } ); // >> which is part of the addEventListener intrinsic api >> >> >> >> On Tue, Jan 29, 2013 at 2:40 PM, Andrew Grieve >> wrote: >> >> > Pretty much the only API we could support on window.opener is >> > postMessage(). >> > >> > We might want to consider exposing a separate interface from >> window.open() >> > for activating an InAppBrowser that you want to do more with (e.g. >>listen >> > to events, inject JS/CSS). >> > >> > >> > On Tue, Jan 29, 2013 at 5:24 PM, Brian LeRoux wrote: >> > >> > > Would it be possible to implement window.opener ?? >> > > >> > > I'm thinking no, due to the async nature of stuff, but allergic to >> > > introducing more non-standard API surface. It might be time to start >> > > documenting where Cordova MUST diverge so we can socialize this w/ >>the >> > > various standards groups we interact with. >> > > >> > > On Tue, Jan 29, 2013 at 9:15 AM, Andrew Grieve >> >> > > wrote: >> > > > No. >> > > > >> > > > We do plan to support asynchronous JS communication in the future >> > though. >> > > > We didn't have a bug for it, so I've now created one: >> > > > https://issues.apache.org/jira/browse/CB-2305 >> > > > >> > > > On Tue, Jan 29, 2013 at 7:35 AM, Dan Mullins >> >> > > wrote: >> > > > >> > > >> If I open a local file in the InAppBrowser, can it communicate >>via >> > > >> javascript to the main application? >> > > >> >> > > >> For instance, if index.html defines the global function >>doSomething >> > > >> and opens local.html: >> > > >> >> > > >> function doSomething(input) { >> > > >> alert('hello ' + input) >> > > >> } >> > > >> >> > > >> document.addEventListener("deviceready", onDeviceReady, false); >> > > >> >> > > >> function onDeviceReady() { >> > > >> iabRef =3D window.open('local.html', '_blank', >> 'location=3Dyes'); >> > > >> } >> > > >> >> > > >> Can local.html call doSomething? >> > > >> function init() { >> > > >> doSomething('child view'); >> > > >> } >> > > >> >> > > >> I'm not having any success and want to make sure I'm not missing >> > > something. >> > > >> >> > > >> Dan >> > > >> >> > > >> > >> >> >> >> -- >> @purplecabbage >> risingj.com >>