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 4D4FAE912 for ; Sat, 1 Dec 2012 00:53:33 +0000 (UTC) Received: (qmail 70422 invoked by uid 500); 1 Dec 2012 00:53:33 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 70393 invoked by uid 500); 1 Dec 2012 00:53:33 -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 70385 invoked by uid 99); 1 Dec 2012 00:53:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2012 00:53:33 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gtanner@gmail.com designates 209.85.223.169 as permitted sender) Received: from [209.85.223.169] (HELO mail-ie0-f169.google.com) (209.85.223.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Dec 2012 00:53:24 +0000 Received: by mail-ie0-f169.google.com with SMTP id c14so1454248ieb.28 for ; Fri, 30 Nov 2012 16:53:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:references:from:content-type:x-mailer:in-reply-to :message-id:date:to:content-transfer-encoding:mime-version; bh=lbDJmJCpoF8TxQIX9q9YmXhxyoaLFLhhGtOJbXxrBMY=; b=trW+0+beVoBVRRIQLAjabo90szRnL7stkS+qfRTWJ89M4yPLVfoGJPhdZf1o1BAlFv x5KqHHVklEfpQIB2c2FI6PppXVqn2zBIef3huPVjLVe6g39ZKzXzSatBzLYeIC4QghOY b00dH+OrJUSq1AOWRh5HrModSU7eH9Wxd/0imwPD1rPnYYz+KUINEqMYM2YI7MRd5Gr0 VLp3I/UvDC4km5CUDeWO8z/EIU/78qLLNX1dr30sCbZAkfx8Coe7lSPt0qGB3pAgg87j O/MrAhJfO82XnNqfZx1zlSfcrUK/gUkh3aUQmwm0HgH+a+Ik5lQunCkRCR+rD45LwDMa ylGA== Received: by 10.50.33.147 with SMTP id r19mr88755igi.73.1354323183832; Fri, 30 Nov 2012 16:53:03 -0800 (PST) Received: from [192.168.1.3] (CPE000d3a725498-CM001cea87a5dc.cpe.net.cable.rogers.com. [173.32.255.15]) by mx.google.com with ESMTPS id bh3sm809226igc.0.2012.11.30.16.53.02 (version=SSLv3 cipher=OTHER); Fri, 30 Nov 2012 16:53:03 -0800 (PST) Subject: Re: Determining if "you're in cordova" References: From: Gord Tanner Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (10A523) In-Reply-To: Message-Id: Date: Fri, 30 Nov 2012 19:53:02 -0500 To: "dev@cordova.apache.org" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (1.0) X-Virus-Checked: Checked by ClamAV on apache.org +1 This isn't a platform issue but rather a developer issue Sent from my iPhone On 2012-11-30, at 7:11 PM, Jesse wrote: > Presumably the developer knows the url of their own server, so > wouldn't it be easier to just test for that in window.location? > > On Fri, Nov 30, 2012 at 4:07 PM, Jesse wrote: >> So the bigger question then is how to handle the differences ... >> >> On Fri, Nov 30, 2012 at 4:04 PM, Filip Maj wrote: >>> It is to run a single codebase (or as close to it as possible minus the >>> differences in cordova.js) across web and cordova apps. >>> >>> On 11/30/12 4:02 PM, "Jesse" wrote: >>> >>>> Can we back up and discuss the goal? >>>> >>>> Is it to use the same code on the server + inside an app ( that is >>>> packaged for multiple platforms ) ? >>>> OR >>>> Is it to load an app on multiple devices all served by the same server? >>>> >>>> >>>> >>>> On Fri, Nov 30, 2012 at 3:56 PM, Shazron wrote: >>>>> Its yucky and may break in a future platform version, but since each >>>>> platform requires its own cordova.js -- then each platform could define >>>>> its >>>>> own cordova.isWebView? >>>>> >>>>> wp7 is x-wmapp >>>>> iOS is file:// >>>>> BB is http://localhost >>>>> Android is ? >>>>> >>>>> >>>>> On Fri, Nov 30, 2012 at 3:49 PM, Jesse wrote: >>>>> >>>>>> WP7 app is loaded from x-wmapp1:/ >>>>>> WP8 app is loaded from x-wmapp0:/ >>>>>> >>>>>> So file:// will not work >>>>>> >>>>>> There are probably numerous other approches ... >>>>>> deviceready will/should never fire, but that is difficult to test for, >>>>>> because it could just be taking a real long time. >>>>>> >>>>>> >>>>>> I see many issues with this though: >>>>>> - each platform still requires it's own cordova.js, so this would only >>>>>> work with 1 platform + a webserver, so no idea we come up for this >>>>>> will solve the bigger problem. >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Nov 30, 2012 at 3:46 PM, Shazron wrote: >>>>>>> document.location starts with http://localhost OR starts with file:// >>>>>> then? >>>>>>> ;) >>>>>>> In any case, any js variable that we could set can be overridden of >>>>>> course. >>>>>>> >>>>>>> >>>>>>> On Fri, Nov 30, 2012 at 3:38 PM, Filip Maj wrote: >>>>>>> >>>>>>>> I think in BB WEbWorks you get http://localhost/somethingsoemthing >>>>>>>> >>>>>>>> On 11/30/12 3:35 PM, "Shazron" wrote: >>>>>>>> >>>>>>>>> "how do we know if we're in cordova or not?" --> document.location >>>>>> starts >>>>>>>>> with file:// ? >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> @purplecabbage >>>>>> risingj.com >>>> >>>> >>>> >>>> -- >>>> @purplecabbage >>>> risingj.com >> >> >> >> -- >> @purplecabbage >> risingj.com > > > > -- > @purplecabbage > risingj.com