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 C8D9610E5A for ; Fri, 24 Jan 2014 16:53:15 +0000 (UTC) Received: (qmail 9319 invoked by uid 500); 24 Jan 2014 16:53:14 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 9285 invoked by uid 500); 24 Jan 2014 16:53:14 -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 9277 invoked by uid 99); 24 Jan 2014 16:53:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jan 2014 16:53:13 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of iclelland@google.com designates 209.85.219.41 as permitted sender) Received: from [209.85.219.41] (HELO mail-oa0-f41.google.com) (209.85.219.41) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Jan 2014 16:53:05 +0000 Received: by mail-oa0-f41.google.com with SMTP id j17so4094948oag.0 for ; Fri, 24 Jan 2014 08:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=WUacnszpOfIGmFqMcUNOSevRVr2vzDgqy1DNM966xoU=; b=D1GlkBcVXWrd7UEPRYQuji5zoRY/0WSsjXDoJlN4JK0hDq1QQOL2L2xs7AeHY9/k+w 0td/4l/UPIgK8ZxR7USkoxPR7GY1q7AzGPIG1BIYjPTvSzI3f1CWyrUbYDdc/VpvNVmH sy1SyEcHZkz8PZrj73496BdzLS/ZtKjtIFpWXCTiaiOKIrFYj5mDQndWjHwo+TOWxqhL oVpgzaeB5nLZAEitSm5XH0FJB97luGv68VZ35ymEpLXt9LUej3cWbx3U/ulLUk5RSCPG kjddptOySe/xhHvD9wIs6A3iRhiWkl2MEItwEFwec27EB1vZaX1jdsvo1ayfHDwM6O2E pqcQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=WUacnszpOfIGmFqMcUNOSevRVr2vzDgqy1DNM966xoU=; b=fsDmGMwTYbLLfwCfp2MdqQt9HuXoDBC1EmQ4DSHm42x/DFGUlN8prqQCOysQ73GtQI gpAUvpGL++9Bo4GXF2IPTMND+OZqrH4roTVkM4IRvJQd2ujSI5nI2Q1R5sfkME0hNF9m jGXeYCQcj2WQOighq962BEpNvgryzWwtKUato= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:content-type; bh=WUacnszpOfIGmFqMcUNOSevRVr2vzDgqy1DNM966xoU=; b=ZdTsB5CiMaxFUTtyDyz28D3MYI+Q6bJ9x8joAGi227vGk3Y7mQ3dA9xsMbETMbgr/p Q72VTU3xIWuP52ihZkP3MzMjPImZ0AN79HzxYrP8ddpDBQ6fFpyB8Glfer87t6ZXuHzV fZ+ptpiOqpu9jGAGLHXNx1RGuAXVnCsCACiNn2JWuoQeetC6G5yRi9jTSfDk5x5VVVCJ JtGEU6zQ3PJDPSmyJiCKvA2AFjVaoMQsF47DMeAHxlPO2MGtFKKWiEkWc+APYozdXHq1 gtYcnKuAZHRGcGng5ZN/h+/PG6nIFFtV3PqYcviwb3HiIU+fxj70d2G7UP2rjLCDAubZ 3RRA== X-Gm-Message-State: ALoCoQkP3cdUWnzgP2/C0xJg7U1OHjHa1p3aZ4/vwQW7Z2czTlkqYnm7Tb3Kpzw40wMUfiKYFTBYtL7a5UyBwTQ43EYwm8Zs0OV4JFTC4y0JykWFzxkMIFNngLmxF1Z0dxj0iVAaBGirP26jJnRQBeHyuSgA3p9VEuXYjnl082BOg908uUS/8sbovEiJu/BJbppnzQ6hkMz/mxrRZTodpvpBYHas8//ygQ== X-Received: by 10.182.97.67 with SMTP id dy3mr298108obb.84.1390582363724; Fri, 24 Jan 2014 08:52:43 -0800 (PST) MIME-Version: 1.0 Sender: iclelland@google.com Received: by 10.182.225.135 with HTTP; Fri, 24 Jan 2014 08:52:22 -0800 (PST) In-Reply-To: References: <56413FAA-C311-4E37-B8E7-BBEEA17CD49F@devgeeks.org> From: Ian Clelland Date: Fri, 24 Jan 2014 11:52:22 -0500 X-Google-Sender-Auth: fmvd_6iz3VZZOuzasCT6Gie3WuE Message-ID: Subject: Re: Configuring the File plugin To: "dev@cordova.apache.org" Content-Type: multipart/alternative; boundary=047d7b2e4c02d2429204f0ba2f6b X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2e4c02d2429204f0ba2f6b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is now pushed to dev. I've updated the docs in the plugin as well as the config.xml that ships with mobile-spec. (I changed the preference name at the last minute -- I remembered CB-4103, and the work that went into standardizing on CamelCase for all of the preference names across platforms) mobile spec now contains If you run mobile spec without this, it will terminate with an assertion failure, and the message File plugin configuration error: Please set iosPersistentFileLocation in config.xml to one of "library" (for new applications) or "documents" (for compatibility with previous versions) appears in the log. I haven't added the message on plugin install yet, but that should be done today. Ian On Thu, Jan 23, 2014 at 11:52 AM, Ian Clelland wrot= e: > Okay, I'm going to do this on dev branch, then: > > File plugin will be *broken by default* on iOS. > Developers will need to add a preference to their apps' config.xml files. > It will look like this: > > or > > unless someone has a really good bikeshed colour. > > On iOS, CDVFile will throw an exception on initialize if this isn't set. > The error in the log will be as explicit as I can make it about what fail= ed > and how to fix it. > > I'm dropping the idea of adding any more XML configuration for supporting > exotic third party plugins. That can be done in native code, by calling t= he > right methods on the file plugin to add new filesystems. No XML; no > javascript: if a plugin needs a special FS root, it can add it. If an app > needs it, the easiest way for now will be to create a plugin that adds it= . > > > > On Tue, Jan 14, 2014 at 4:14 PM, Shazron wrote: > >> I agree with the plugin broken by default, and requiring From my >> experience, doing anything fancy for users to ease migration rarely does >> what is intended - and causes more problems, my 2c >> >> FileMigrator plugin is great, externalizes the problem >> >> >> On Tue, Jan 14, 2014 at 1:10 PM, Andrew Grieve >> wrote: >> >> > Migration isn't possible by default because the current location for >> > Android is the root of the SD Card. >> > >> > The goal here is to put PERSISTENT under Library, but to also make >> > other interesting places available via other URLs / FileSystem >> > objects. >> > >> > So far my fav. is to have the plugin broken by default so that users >> > will be forced to add a pref to set either old / new location. Really >> > don't want new apps being written with data in the wrong spot. >> > >> > For the case of configuring custom locations, I think a native API is >> > more workable than configuration. >> > >> > >> > On Tue, Jan 14, 2014 at 4:05 PM, Tommy-Carlos Williams >> > wrote: >> > > Sorry=E2=80=A6 >> > > >> > > I have been trying not to chicken-little this thread, but I just nee= d >> > some clarification on some things. >> > > >> > > My understanding, please correct me if I am wrong: >> > > >> > > The =E2=80=9Cold" location on iOS is not the best location for files= the dev >> > doesn=E2=80=99t want exposed, but it *is* where they should be if the = dev wants >> > them accessible via iTunes >> > > >> > > Assuming this is correct, I have some questions: >> > > >> > > 1. What if that=E2=80=99s where the dev *wants* the files to go? >> > > 2. Could files still be backed up by iCloud if they were in the new >> > location? >> > > >> > > >> > > It feels like making assumptions about what kinds of files developer= s >> > are using the File API for. >> > > >> > > :/ >> > > >> > > - tommy >> > > >> > > >> > > >> > > On 15 Jan 2014, at 7:09 am, Ian Clelland >> wrote: >> > > >> > >> On Tue, Jan 14, 2014 at 2:52 PM, Brian LeRoux wrote: >> > >> >> > >>> Wait, users lose data IF they upgrade the plugin. Is that correct? >> > >>> >> > >> >> > >> *If* we change the default storage location, and *if* a developer >> > upgrades >> > >> the file plugin without looking too closely (because, hey, newer is >> > always >> > >> better, right?) and pushes a new version of the app to existing >> users, >> > then >> > >> yes, users will lose access to the data that they previously had >> stored. >> > >> >> > >> Technically, they aren't losing the data; it's still possible to ge= t >> to >> > it, >> > >> someday, maybe, if the developer does a lot of work to fix the app, >> and >> > it >> > >> hasn't ended up in some inconsistent state -- it's not deleted, >> though. >> > >> >> > >> And I do believe that developers will do that, too. Maybe not the >> good >> > ones >> > >> :) But people will gloss over the upgrade instructions, read the >> > warnings >> > >> without thinking "oh, that affects my users", and publish away. >> > >> >> > >> >> > >>> >> > >>> >> > >>> On Tue, Jan 14, 2014 at 10:53 AM, Ian Clelland < >> iclelland@chromium.org >> > >>>> wrote: >> > >>> >> > >>>> On Tue, Jan 14, 2014 at 1:44 PM, Brian LeRoux wrote: >> > >>>> >> > >>>>> So, to be clear and terse: what are the use cases / why are we >> adding >> > >>>> more >> > >>>>> config? >> > >>>>> >> > >>>> >> > >>>> 1. NSDocumentsDirectory is a stupid place to put the HTML >> filesystem >> > on >> > >>>> iOS. NSLibraryDirectory is a more sensible place, and I'd love to >> > change >> > >>> it >> > >>>> as part of this rollout, *but* >> > >>>> 2. If we change it unilaterally, real users are going to lose >> access >> > to >> > >>>> real data. >> > >>>> >> > >>>> Also, >> > >>>> 3. The File plugin is much more modular now, and we could >> potentially >> > >>> have >> > >>>> a whole ecosystem of Filesystem providers making filesystem-shape= d >> > >>> things, >> > >>>> but it needs to be configurable to be useful. >> > >>>> >> > >>>> #3 is less important at the moment, but becomes more compelling i= f >> we >> > >>>> provide the machinery for other devs to take advantage of it. >> > >>>> >> > >>>> >> > >>>> >> > >>>>> >> > >>>>> On Tue, Jan 14, 2014 at 10:34 AM, Ian Clelland < >> > iclelland@chromium.org >> > >>>>>> wrote: >> > >>>>> >> > >>>>>> On Tue, Jan 14, 2014 at 10:52 AM, Andrew Grieve < >> > >>> agrieve@chromium.org >> > >>>>>>> wrote: >> > >>>>>> >> > >>>>>>> On Tue, Jan 14, 2014 at 10:38 AM, Ian Clelland < >> > >>>> iclelland@chromium.org >> > >>>>>> >> > >>>>>>> wrote: >> > >>>>>>>> On Mon, Jan 13, 2014 at 9:16 PM, Andrew Grieve < >> > >>>> agrieve@chromium.org >> > >>>>>> >> > >>>>>>> wrote: >> > >>>>>>>> >> > >>>>>>>>> I think we need two things for transitioning to different >> > >>>>> PERSISTENT / >> > >>>>>>>>> TEMPORARY locations: >> > >>>>>>>>> 1. The ability for the user to retrieve the files at the old >> > >>>>> location >> > >>>>>>>>> (so they can be moved to the new location) >> > >>>>>>>>> 2. The ability to turn turn on the change with a switch (e.g= . >> > >>>>>>>>> ) >> > >>>>>>>>> >> > >>>>>>>>> I'd love for the default to be the new locations so that new >> > >>> apps >> > >>>>>>>>> don't forget to turn on the preference and find out they nee= d >> to >> > >>>>>>>>> migrate later on. >> > >>>>>>>>> >> > >>>>>>>> >> > >>>>>>>> This is the really dangerous bit, though. If we make the >> default >> > >>>>>> anything >> > >>>>>>>> but the current behaviour, then devs *will* update their >> plugins >> > >>>> and >> > >>>>>>> push, >> > >>>>>>>> and users *will* lose the ability to access old saved files. = We >> > >>>> will >> > >>>>>>>> absolutely encounter the situation where developers test thei= r >> > >>> app >> > >>>>> with >> > >>>>>>>> blank filesystems, and everything works fine, but data is >> > >>> rendered >> > >>>>>>>> inaccessible to users who upgrade from an old version. And I'= m >> > >>> sure >> > >>>>>> it'll >> > >>>>>>>> happen no matter how loudly we announce the change. >> > >>>>>>>> >> > >>>>>>>> I would sooner make the new plugin be "broken by default", so >> > >>> that >> > >>>>> the >> > >>>>>>> app >> > >>>>>>>> doesn't even start until you add a configuration preference, >> one >> > >>>> way >> > >>>>> or >> > >>>>>>> the >> > >>>>>>>> other. Then we could recommend at that time, "if you have an >> > >>>> existing >> > >>>>>> app >> > >>>>>>>> with users, then use the old value; if this is a brand new ap= p, >> > >>> use >> > >>>>> the >> > >>>>>>> new >> > >>>>>>>> one". >> > >>>>>>> >> > >>>>>>> I really like this idea! >> > >>>>>>> >> > >>>>>>>> >> > >>>>>>>> Also - the simpler our instructions can be, the better. I don= 't >> > >>>> think >> > >>>>>>>>> most devs even realize that they are doing a foolish thing >> with >> > >>>> the >> > >>>>>>>>> way things are set up right now, so telling them to configur= e >> > >>>> their >> > >>>>>>>>> own paths might put too much of a burden on them (they'd hav= e >> to >> > >>>>> learn >> > >>>>>>>>> where files should go, and then also figure out how our conf= ig >> > >>>>> syntax >> > >>>>>>>>> works). >> > >>>>>>>>> >> > >>>>>>>> >> > >>>>>>>> True. The simple case should be as simple as possible. Ideall= y, >> > >>>> doing >> > >>>>>>>> nothing at all should get them some reasonable behaviour, >> > >>>> compatible >> > >>>>>> with >> > >>>>>>>> previous versions. >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> The case of adding new FS roots is compelling, but I think >> most >> > >>>>> users >> > >>>>>>>>> would appreciate FS roots for content, assets, sdcard, etc t= o >> be >> > >>>>>>>>> pre-built-in rather than have to wire them up themselves. >> > >>>>>>>>> >> > >>>>>>>> >> > >>>>>>>> Agreed. Those ones should be available out-of-the-box, either >> as >> > >>>> part >> > >>>>>> of >> > >>>>>>>> File, or as part of a related plugin. (Leaning towards File, >> > >>> since >> > >>>> it >> > >>>>>> is >> > >>>>>>>> already providing content and assets filesystem URLs) >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>>> One thing that jumped out to me is the src=3D argument: >> > >>>>>>>>> > > >>>>>>>>> type=3D"local-filesystem" >> > >>>>>>>>> prefix=3D"cdvfile://localhost/documents" >> > >>>>>>>>> src=3D"Documents" /> >> > >>>>>>>>> >> > >>>>>>>>> If the goal is for these to be customizable, then it's not >> that >> > >>>>>>>>> flexible to use pre-defined values in the src=3D argument. >> Perhaps >> > >>>>>>>>> instead of using config.xml, the File plugin could have a >> > >>>>>>>>> registerFileSystemRoot(name, type, prefix, rootPath) functio= n >> > >>> that >> > >>>>>>>>> could be used for this purpose. That way plugins could compu= te >> > >>>> their >> > >>>>>>>>> root paths and then call this function at plugin init time. >> > >>>>>>>>> >> > >>>>>>>> >> > >>>>>>>> That was mostly an off-the-top-of-my-head strawman for the >> > >>> format. >> > >>>>>>> However, >> > >>>>>>>> it does address the issue of how to specify "this filesystem >> > >>> lives >> > >>>> at >> > >>>>>> the >> > >>>>>>>> NSTemporaryDirectory location; that one lives at >> > >>>> NSLibraryDirectory", >> > >>>>>>>> without having to know the real filesystem path for those >> things. >> > >>>>>>>> >> > >>>>>>>> I expected that the interpretation of something like a "src" >> > >>>>> attribute >> > >>>>>>>> would be very dependent on the filesystem type, and specializ= ed >> > >>> to >> > >>>>> that >> > >>>>>>>> type, rather than representing an absolute device fs path. >> > >>>>>>> >> > >>>>>>> If the valid values here are pre-determined by the FS type, >> then I >> > >>>>>>> don't know why we'd have this configuration. >> > >>>>>>> Let's just expose all of the roots that the FS knows about. If >> we >> > >>>> want >> > >>>>>>> to be able to toggle some on/off, then let's add a pref for >> > >>>>>>> "fs-type-whitelist" which is just a comma-separated-list. >> > >>>>>>> >> > >>>>>>> >> > >>>>>> >> > >>>>>> A comma-separated list isn't so bad; in fact, given the call >> > >>> signature >> > >>>> of >> > >>>>>> requestFileSystem, the *order* of items in that list may be the >> > >>>> critical >> > >>>>>> thing. A CSL is certainly easier to shoehorn into our existing >> > config >> > >>>>>> parsing than a whole block of XML, even if it's a bit uglier. >> > >>>>>> >> > >>>>>> What about something shaped like >> > >>>>>> >> > >>>>>> > > >>>> value=3D"temporary,documents,assets,library" >> > >>>>>> /> >> > >>>>>> >> > >>>>>> Then you could switch "documents" and "library" in the list, an= d >> you >> > >>>>> would >> > >>>>>> be storing files in the new position (by the definition of >> > >>>>>> window.PERSISTENT). >> > >>>>>> >> > >>>>>> Ian >> > >>>>>> >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> Another thing that occurred to me (maybe off topic?): Why: >> > >>>>>>>>> cdvfile://localhost/documents >> > >>>>>>>>> instead of: >> > >>>>>>>>> cdvfile://documents/ >> > >>>>>>>>> Looking at this URL-wise, I think it would be a nice-to-have >> to >> > >>>> have >> > >>>>>>>>> the type encoded as the hostname so that root-relative URLs >> > >>> would >> > >>>>> work >> > >>>>>>>>> with the URLS. >> > >>>>>>>>> >> > >>>>>>>> >> > >>>>>>>> We discussed this at the Waterloo meetup, and there was >> > >>> definitely >> > >>>>> some >> > >>>>>>>> push for having the authority part in the URL be the real >> > >>> authority >> > >>>>>>>> (localhost), for consistent URL handling. >> > >>>>>>>> >> > >>>>>>>> Having the FS type be the authority would make some of the >> > >>> internal >> > >>>>> URL >> > >>>>>>>> parsing easier, but I don't know if it causes problems anywhe= re >> > >>>> else. >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> Could we get away with just two parameters to each FS root? >> > >>>>>>>>> 1. Name (use this to determine prefix as cdvfile://${name}) >> > >>>>>>>>> 2. src (URI to be considered the root of the FS). >> > >>>>>>>>> >> > >>>>>>>> >> > >>>>>>>> Those are, internally, the parameters used by the "local >> > >>>> filesystem" >> > >>>>> FS >> > >>>>>>>> type (i.e., not "content" or "assets library".) The actual >> > >>>> device-FS >> > >>>>>>> root, >> > >>>>>>>> though, is currently determined at run time by the device, >> based >> > >>> on >> > >>>>>>> whether >> > >>>>>>>> it is the temporary or persistent FS. >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> >> > >>>>>>>>> On Mon, Jan 13, 2014 at 4:29 PM, Ian Clelland < >> > >>>>> iclelland@chromium.org >> > >>>>>>> >> > >>>>>>>>> wrote: >> > >>>>>>>>>> On Mon, Jan 13, 2014 at 3:21 PM, Jesse < >> > >>> purplecabbage@gmail.com >> > >>>>> >> > >>>>>>> wrote: >> > >>>>>>>>>> >> > >>>>>>>>>>> Will any of the following work? >> > >>>>>>>>>>> >> > >>>>>>>>>>> >> > >>>>>>>>>>> >> > >>>>>>>>>>> xhr.open("GET","cdvfile://localhost/persistent/data.txt"); >> > >>>>>>>>>>> >> > >>>>>>>>>>> > > >>>>>>>>>>> href=3D"cdvfile://localhost/persistent/style.css"/> >> > >>>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>>> If the new file plugin is installed, and the file exists, >> then >> > >>>> the >> > >>>>>>> first >> > >>>>>>>>>> three of those should definitely work (assuming the default >> > >>>>>>>>> configuration). >> > >>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>>>> >> > >>>>>>>>>>> > > >>>>>>>>>>> target=3D"_blank">Review Site >> > >>>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>>> I'm not sure about this -- haven't tried it. If it's doing >> > >>>>>> navigation, >> > >>>>>>>>> then >> > >>>>>>>>>> I don't know how it plays with the fact that plugins get >> > >>>> unloaded >> > >>>>> or >> > >>>>>>>>> reset >> > >>>>>>>>>> at some point. >> > >>>>>>>>>> >> > >>>>>>>>>> The in-app-browser version of this: >> > >>>>>>>>>> >> > >>>>>>>>>> window.open("cdvfile://localhost/temporary/site/temp.html", >> > >>>>>> "_blank") >> > >>>>>>>>>> >> > >>>>>>>>>> should work just fine. >> > >>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>>> >> > >>>>>>>>>>> >> > >>>>>>>>>>> >> > >>>>>>>>>>> @purplecabbage >> > >>>>>>>>>>> risingj.com >> > >>>>>>>>>>> >> > >>>>>>>>>>> >> > >>>>>>>>>>> On Mon, Jan 13, 2014 at 10:37 AM, Brian LeRoux >> > >>>>> wrote: >> > >>>>>>>>>>> >> > >>>>>>>>>>>> I am apprehensive about making this surface configurable. >> > >>> (I >> > >>>>> can >> > >>>>>>> live >> > >>>>>>>>> w/ >> > >>>>>>>>>>>> our own protocol cdvfile:// personally). >> > >>>>>>>>>>>> >> > >>>>>>>>>>>> The main use case is being able to add custom storage >> > >>>> providers >> > >>>>>> in >> > >>>>>>> the >> > >>>>>>>>>>>> future? >> > >>>>>>>>>>>> >> > >>>>>>>>>>>> (Might be good to add this to the 'lets talk configuratio= n' >> > >>>>>>> backlog / >> > >>>>>>>>>>>> meeting.) >> > >>>>>>>>>>>> >> > >>>>>>>>>>>> >> > >>>>>>>>>>>> On Mon, Jan 13, 2014 at 7:32 AM, Ian Clelland < >> > >>>>>>> iclelland@chromium.org >> > >>>>>>>>>>>>> wrote: >> > >>>>>>>>>>>> >> > >>>>>>>>>>>>> The new File plugin is essentially ready, for iOS and >> > >>>> Android >> > >>>>>>> (with, >> > >>>>>>>>>>>>> hopefully, no breaking changes for those or other >> > >>>> platforms) >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> I had to move away from the "filesystem://" URL scheme -= - >> > >>>> on >> > >>>>>>> Android >> > >>>>>>>>>>> 4.4, >> > >>>>>>>>>>>>> that scheme appears to be special, and doesn't defer to >> > >>>>>>>>>>>>> WebView.shouldInterceptRequest(). (I filed >> > >>>>>>>>>>>>> >> > >>>> https://code.google.com/p/chromium/issues/detail?id=3D333395on >> > >>>>>>>>> Friday >> > >>>>>>>>>>>> once >> > >>>>>>>>>>>>> I >> > >>>>>>>>>>>>> had isolated the problem.) For now, I've settled on >> > >>>>>> "cdvfile://", >> > >>>>>>>>> but >> > >>>>>>>>>>> the >> > >>>>>>>>>>>>> issue is open to bikeshedding, I suppose. >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> What I'd really like to open for discussion though, is >> > >>> the >> > >>>>> idea >> > >>>>>>> of >> > >>>>>>>>>>> making >> > >>>>>>>>>>>>> the whole plugin configuration, er, configurable. >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> The URL scheme is one driving force behind this; the >> > >>>>> historical >> > >>>>>>>>>>> locations >> > >>>>>>>>>>>>> of the TEMPORARY and PERSISTENT filesystems is another; >> > >>> the >> > >>>>> new >> > >>>>>>>>> ability >> > >>>>>>>>>>>> to >> > >>>>>>>>>>>>> open up completely new filesystems is a third. >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> I'm thinking of implementing a section in config.xml tha= t >> > >>>>> would >> > >>>>>>>>> define >> > >>>>>>>>>>>> the >> > >>>>>>>>>>>>> names of the installed filesystems available to a Cordov= a >> > >>>>> app, >> > >>>>>>> along >> > >>>>>>>>>>> with >> > >>>>>>>>>>>>> their type, the URL prefix to use, and any other require= d >> > >>>>>> details >> > >>>>>>>>> (like >> > >>>>>>>>>>>>> *where the files live*). Something like this: >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/temporary" src=3D"cache" /= > >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/persistent" src=3D"Documen= ts" >> > >>> /> >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> prefix=3D"content://" /> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> or >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> > > >>> type=3D"local-filesystem" >> > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/temporary" src=3D"cache" /= > >> > >>>>>>>>>>>>> > > >>> type=3D"local-filesystem" >> > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/persistent" src=3D"Documen= ts" >> > >>> /> >> > >>>>>>>>>>>>> > > >>> type=3D"content-filesystem" >> > >>>>>>>>>>>>> prefix=3D"content://" /> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> (The platform's defaults.xml, or whatever we're calling >> > >>> it >> > >>>>>> these >> > >>>>>>>>> days, >> > >>>>>>>>>>>>> could specify the default mapping, so that devs could >> > >>> write >> > >>>>>>>>>>>> cross-platform >> > >>>>>>>>>>>>> apps without having to add this for every platform, or >> > >>> even >> > >>>>> at >> > >>>>>>> all, >> > >>>>>>>>> if >> > >>>>>>>>>>>> they >> > >>>>>>>>>>>>> don't care to change it) >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> I think that being this explicit will let us change the >> > >>> url >> > >>>>>>> scheme >> > >>>>>>>>> as >> > >>>>>>>>>>>>> needed (hopefully cdvfile won't need to change, but it >> > >>>> would >> > >>>>>> have >> > >>>>>>>>> if it >> > >>>>>>>>>>>> was >> > >>>>>>>>>>>>> still "filesystem"). It could eventually allow new FS >> > >>>> plugins >> > >>>>>> to >> > >>>>>>> be >> > >>>>>>>>>>> added >> > >>>>>>>>>>>>> to an app with this mechanism. And it would mean that we >> > >>>>> could >> > >>>>>>> roll >> > >>>>>>>>>>> out a >> > >>>>>>>>>>>>> default configuration that left the iOS files in their >> > >>>>> current >> > >>>>>>>>>>> locations: >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> type=3D"local-filesystem" >> > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/temporary" >> > >>>>>>>>>>>>> src=3D"Temporary" /> >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> type=3D"local-filesystem" >> > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/persistent" >> > >>>>>>>>>>>>> src=3D"Documents" /> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> and then, in a later version, we could change the defaul= t >> > >>>> for >> > >>>>>> new >> > >>>>>>>>>>>> projects >> > >>>>>>>>>>>>> to >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> type=3D"local-filesystem" >> > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/temporary" >> > >>>>>>>>>>>>> src=3D"Temporary" /> >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> type=3D"local-filesystem" >> > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/persistent" >> > >>>>>>>>>>>>> src=3D"Library" /> >> > >>>>>>>>>>>>> > > >>>>>>>>>>>>> type=3D"local-filesystem" >> > >>>>>>>>>>>>> prefix=3D"cdvfile://localhost/documents" >> > >>>>>>>>>>>>> src=3D"Documents" /> >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> and existing projects shouldn't see any change. And in >> > >>> the >> > >>>>>>> meantime, >> > >>>>>>>>>>> any >> > >>>>>>>>>>>>> dev who wanted to use the more sensible filesystem >> > >>>> locations >> > >>>>>>> could >> > >>>>>>>>> just >> > >>>>>>>>>>>>> change their own config.xml. >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> I'm going to take a stab at implementing this as >> > >>> described, >> > >>>>> but >> > >>>>>>>>>>>> discussion >> > >>>>>>>>>>>>> is certainly welcome before it goes out to the world. As >> > >>>>>> multiple >> > >>>>>>>>>>> people >> > >>>>>>>>>>>>> have said, we need to get this right, and not hurt all o= f >> > >>>> our >> > >>>>>>>>> existing >> > >>>>>>>>>>>>> devs. >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>>> Ian >> > >>>>>>>>>>>>> >> > >>>>>>>>>>>> >> > >>>>>>>>>>> >> > >>>>>>>>> >> > >>>>>>> >> > >>>>>> >> > >>>>> >> > >>>> >> > >>> >> > > >> > >> > > --047d7b2e4c02d2429204f0ba2f6b--