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 C38E7FBC8 for ; Wed, 20 Mar 2013 18:54:15 +0000 (UTC) Received: (qmail 84074 invoked by uid 500); 20 Mar 2013 18:54:15 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 84043 invoked by uid 500); 20 Mar 2013 18:54:15 -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 84034 invoked by uid 99); 20 Mar 2013 18:54:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 18:54:15 +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.191 as permitted sender) Received: from [64.18.1.191] (HELO exprod6og106.obsmtp.com) (64.18.1.191) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Mar 2013 18:54:09 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob106.postini.com ([64.18.5.12]) with SMTP ID DSNKUUoFu8GufQRViTNsmzpF6n3/3c/jhYD/@postini.com; Wed, 20 Mar 2013 11:53:48 PDT 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 r2KIrk2h020305 for ; Wed, 20 Mar 2013 11:53:46 -0700 (PDT) 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 r2KIrgXO005499 for ; Wed, 20 Mar 2013 11:53:45 -0700 (PDT) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nahub01.corp.adobe.com ([10.8.189.97]) with mapi; Wed, 20 Mar 2013 11:53:44 -0700 From: Filip Maj To: "dev@cordova.apache.org" Date: Wed, 20 Mar 2013 11:53:45 -0700 Subject: (CB-2600) Mobile Spec cordova.js only works for Android and IOS Thread-Topic: (CB-2600) Mobile Spec cordova.js only works for Android and IOS Thread-Index: Ac4lnD6SuITtq4DiTMSr1mhmbyN9xg== 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.3.2.130206 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 Please see CB-2600 for details, but I want to bring this issue back to the list: the cordova.js loader in mobile-spec inspecting userAgent to determine what extra cordova.js to load. Why I'm against it: 1. It's sole purpose is to pander to laziness. The SINGLE use case it exists for is making a change in cordova-js, rebuilding cordova-js, and copying cordova.platform.js into a cordova project with mobile-spec as its app, and not requiring a rename of the cordova.platform.js file. As if running an extra `mv cordova.platform.js cordova-x.x.x.js` was too much! 2. Currently we only inspect for the string "Android" in the userAgent [1]. FirefoxOS, webos, windows phone platforms, etc. etc. not accounted for. Every new platform that comes in needs to be accounted for in the test suite. 3. Failed script loads lead to unreliable behavior on certain platforms. See the comment at [2]. So just wrap it in try-catch? 4. Introduction of a new global flag to completely avoid this behavior? [3] This all looks like amateur hour to me for, at best, marginal benefit. [1]=20 https://github.com/apache/cordova-mobile-spec/blob/master/cordova.js#L23 [2]=20 https://github.com/apache/cordova-mobile-spec/blob/master/cordova.js#L32 [3]=20 https://github.com/apache/cordova-mobile-spec/blob/master/cordova.js#L46 On 3/20/13 11:43 AM, "Filip Maj (JIRA)" wrote: > > [=20 >https://issues.apache.org/jira/browse/CB-2600?page=3Dcom.atlassian.jira.pl= ug >in.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D13607986#comm= en >t-13607986 ]=20 > >Filip Maj commented on CB-2600: >------------------------------- > >I _really really really_ dislike this whole approach. It offers little to >no benefit, and maintaining this function requires reviewing the >mobile-spec cordova.js loader with every platform we introduce. > >I am adamantly against inspecting userAgent for anything we do. This is >not in the spirit of the cordova project, let alone a good practice. > =20 >> Mobile Spec cordova.js only works for Android and IOS >> ----------------------------------------------------- >> >> Key: CB-2600 >> URL: https://issues.apache.org/jira/browse/CB-2600 >> Project: Apache Cordova >> Issue Type: Bug >> Components: mobile-spec >> Reporter: Jeffrey Heifetz >> Assignee: Tim Kim >> Priority: Blocker >> Original Estimate: 12h >> Remaining Estimate: 12h >> >> Cordova.js attempts to load platform specific JS, but limits to only >>android or ios. > >-- >This message is automatically generated by JIRA. >If you think it was sent incorrectly, please contact your JIRA >administrators >For more information on JIRA, see: http://www.atlassian.com/software/jira