You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Joe Bowser <bo...@gmail.com> on 2013/09/18 23:31:35 UTC

[Android] The state of WebSQL on Android 4.x

Ok, We've been ignoring this for quite a while, but it's not going away:

There's still people who want to use WebSQL, and WebSQL is still
totally broken.  Part of the reason it's broken is the fact that
Android prevents us from using the official WebSQL API on file URIs,
and that we have a nasty collision with the official API on Android.

So, what should we do?
1. Use a custom URI scheme?
2. Fix the JS so it aliases the existing WebSQL, and keep using our
own WebSQL plugin.
3. Just say it's deprecated and leave it at that?

If we say we're tossing WebSQL by the wayside, what do we support
instead?  Seriously, what do people think of this, because I'm not
sure what we should do here.

Joe

Re: [Android] The state of WebSQL on Android 4.x

Posted by Andrew Grieve <ag...@chromium.org>.
Finally following up on this.
Create JIRA: https://issues.apache.org/jira/browse/CB-4986

And checked in a plugin called "org.apache.cordova.websql" to
cordova-labs/plugins.
https://git-wip-us.apache.org/repos/asf?p=cordova-labs.git;h=3d26e5d

Pushed it to the registry.


On Fri, Sep 20, 2013 at 1:46 PM, Michal Mocny <mm...@chromium.org> wrote:

> Thats a super cool solution!  I agree that updating what's inside
> cordova-labs and leaving it there is a good option for "written by us, but
> not quite core".
>
> -Michal
>
>
> On Thu, Sep 19, 2013 at 7:23 PM, Andrew Grieve <ag...@chromium.org>wrote:
>
>> Managed to get a simpler version of my email coding to work!
>>
>>         var ifr = document.createElement('iframe');
>> >         ifr.src = "websql://foo";
>> >         ifr.onload = function() {
>> >           window.openDatabase = function() {
>> >                return
>> > ifr.contentWindow.openDatabase.apply(ifr.contentWindow, arguments);
>> >           };
>> >
>>
>> Also needs a couple lines of Java to return "<html></html>"  for the
>> request to "websql://foo"
>>
>> The gotcha here is that you need to make sure to not detach the iframe
>> from
>> the document. No biggie, but need to be aware of it.
>>
>> This can all be easily put into a plugin without any modification to core
>> :) The existing android storage plugin is in cordova-labs#plugins. I think
>> the right move would be to update this plugin, post it to the registry,
>> and
>> tell people about it?
>>
>>
>> On Thu, Sep 19, 2013 at 5:03 PM, Joe Bowser <bo...@gmail.com> wrote:
>>
>> > OK, I tried the tests included with the plugin, and they don't run.
>> > Can someone sanity check this for me?  I'm going to try running this
>> > on additional devices, since it could be a weird Cyanogen thing.  But
>> > yeah, if other people can try this plugin, that'd be awesome.
>> >
>> > On Thu, Sep 19, 2013 at 10:12 AM, Andrew Grieve <ag...@chromium.org>
>> > wrote:
>> > > Tried out my email code, and despite my confidence, it doesn't work
>> :P.
>> > >
>> > > So... Joe - like your plan.
>> > >
>> > >
>> > > On Thu, Sep 19, 2013 at 12:32 PM, Brian LeRoux <b...@brian.io> wrote:
>> > >>
>> > >> yup.
>> > >>
>> > >>
>> > >> On Thu, Sep 19, 2013 at 5:42 PM, Joe Bowser <bo...@gmail.com>
>> wrote:
>> > >>
>> > >> > OK, how about we do this:
>> > >> >
>> > >> > 1. We indicate that we no longer support WebSQL on the docs and we
>> > >> > list out why we don't support it as it currently exists
>> > >> > 2. I'll look at the Android plugin that does do SQLite and see if
>> it's
>> > >> > appropriate for Android (if someone could do the same for iOS,
>> that'd
>> > >> > be cool): https://github.com/lite4mobi/Cordova-SQLitePlugin
>> > >> >
>> > >> > I think this looks far more promising than any of the hokey
>> bullshit
>> > >> > that we're currently doing, and it has contributors, and it's
>> actually
>> > >> > updated for Cordova 3.0.
>> > >> >
>> > >> > On Thu, Sep 19, 2013 at 7:53 AM, Ian Clelland <
>> iclelland@chromium.org
>> > >
>> > >> > wrote:
>> > >> > > On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com>
>> > >> > > wrote:
>> > >> > >
>> > >> > >> OK, here's a crazy concept that I'm going to throw out there.
>> > >> > >>
>> > >> > >> How about we audit and recommend a third-party plugin and not do
>> > any
>> > >> > >> more work on this issue.
>> > >> > >
>> > >> > >
>> > >> > > +1
>> > >> > >
>> > >> > > I don't think there's enough consensus about whether WebSQL even
>> > >> > > belongs
>> > >> > in
>> > >> > > the web platform for us to be insisting that it be part of
>> Cordova.
>> > I
>> > >> > would
>> > >> > > much rather see someone with a real interest in WebSQL be
>> providing
>> > >> > > that
>> > >> > > functionality. Our job can be to make sure that we aren't
>> getting in
>> > >> > > the
>> > >> > > way; that we are helping make plugins like that possible.
>> > >> > >
>> > >> > > Ian
>> > >> >
>> > >
>> > >
>> >
>>
>
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Michal Mocny <mm...@chromium.org>.
Thats a super cool solution!  I agree that updating what's inside
cordova-labs and leaving it there is a good option for "written by us, but
not quite core".

-Michal


On Thu, Sep 19, 2013 at 7:23 PM, Andrew Grieve <ag...@chromium.org> wrote:

> Managed to get a simpler version of my email coding to work!
>
>         var ifr = document.createElement('iframe');
> >         ifr.src = "websql://foo";
> >         ifr.onload = function() {
> >           window.openDatabase = function() {
> >                return
> > ifr.contentWindow.openDatabase.apply(ifr.contentWindow, arguments);
> >           };
> >
>
> Also needs a couple lines of Java to return "<html></html>"  for the
> request to "websql://foo"
>
> The gotcha here is that you need to make sure to not detach the iframe from
> the document. No biggie, but need to be aware of it.
>
> This can all be easily put into a plugin without any modification to core
> :) The existing android storage plugin is in cordova-labs#plugins. I think
> the right move would be to update this plugin, post it to the registry, and
> tell people about it?
>
>
> On Thu, Sep 19, 2013 at 5:03 PM, Joe Bowser <bo...@gmail.com> wrote:
>
> > OK, I tried the tests included with the plugin, and they don't run.
> > Can someone sanity check this for me?  I'm going to try running this
> > on additional devices, since it could be a weird Cyanogen thing.  But
> > yeah, if other people can try this plugin, that'd be awesome.
> >
> > On Thu, Sep 19, 2013 at 10:12 AM, Andrew Grieve <ag...@chromium.org>
> > wrote:
> > > Tried out my email code, and despite my confidence, it doesn't work :P.
> > >
> > > So... Joe - like your plan.
> > >
> > >
> > > On Thu, Sep 19, 2013 at 12:32 PM, Brian LeRoux <b...@brian.io> wrote:
> > >>
> > >> yup.
> > >>
> > >>
> > >> On Thu, Sep 19, 2013 at 5:42 PM, Joe Bowser <bo...@gmail.com>
> wrote:
> > >>
> > >> > OK, how about we do this:
> > >> >
> > >> > 1. We indicate that we no longer support WebSQL on the docs and we
> > >> > list out why we don't support it as it currently exists
> > >> > 2. I'll look at the Android plugin that does do SQLite and see if
> it's
> > >> > appropriate for Android (if someone could do the same for iOS,
> that'd
> > >> > be cool): https://github.com/lite4mobi/Cordova-SQLitePlugin
> > >> >
> > >> > I think this looks far more promising than any of the hokey bullshit
> > >> > that we're currently doing, and it has contributors, and it's
> actually
> > >> > updated for Cordova 3.0.
> > >> >
> > >> > On Thu, Sep 19, 2013 at 7:53 AM, Ian Clelland <
> iclelland@chromium.org
> > >
> > >> > wrote:
> > >> > > On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com>
> > >> > > wrote:
> > >> > >
> > >> > >> OK, here's a crazy concept that I'm going to throw out there.
> > >> > >>
> > >> > >> How about we audit and recommend a third-party plugin and not do
> > any
> > >> > >> more work on this issue.
> > >> > >
> > >> > >
> > >> > > +1
> > >> > >
> > >> > > I don't think there's enough consensus about whether WebSQL even
> > >> > > belongs
> > >> > in
> > >> > > the web platform for us to be insisting that it be part of
> Cordova.
> > I
> > >> > would
> > >> > > much rather see someone with a real interest in WebSQL be
> providing
> > >> > > that
> > >> > > functionality. Our job can be to make sure that we aren't getting
> in
> > >> > > the
> > >> > > way; that we are helping make plugins like that possible.
> > >> > >
> > >> > > Ian
> > >> >
> > >
> > >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Andrew Grieve <ag...@chromium.org>.
Managed to get a simpler version of my email coding to work!

        var ifr = document.createElement('iframe');
>         ifr.src = "websql://foo";
>         ifr.onload = function() {
>           window.openDatabase = function() {
>                return
> ifr.contentWindow.openDatabase.apply(ifr.contentWindow, arguments);
>           };
>

Also needs a couple lines of Java to return "<html></html>"  for the
request to "websql://foo"

The gotcha here is that you need to make sure to not detach the iframe from
the document. No biggie, but need to be aware of it.

This can all be easily put into a plugin without any modification to core
:) The existing android storage plugin is in cordova-labs#plugins. I think
the right move would be to update this plugin, post it to the registry, and
tell people about it?


On Thu, Sep 19, 2013 at 5:03 PM, Joe Bowser <bo...@gmail.com> wrote:

> OK, I tried the tests included with the plugin, and they don't run.
> Can someone sanity check this for me?  I'm going to try running this
> on additional devices, since it could be a weird Cyanogen thing.  But
> yeah, if other people can try this plugin, that'd be awesome.
>
> On Thu, Sep 19, 2013 at 10:12 AM, Andrew Grieve <ag...@chromium.org>
> wrote:
> > Tried out my email code, and despite my confidence, it doesn't work :P.
> >
> > So... Joe - like your plan.
> >
> >
> > On Thu, Sep 19, 2013 at 12:32 PM, Brian LeRoux <b...@brian.io> wrote:
> >>
> >> yup.
> >>
> >>
> >> On Thu, Sep 19, 2013 at 5:42 PM, Joe Bowser <bo...@gmail.com> wrote:
> >>
> >> > OK, how about we do this:
> >> >
> >> > 1. We indicate that we no longer support WebSQL on the docs and we
> >> > list out why we don't support it as it currently exists
> >> > 2. I'll look at the Android plugin that does do SQLite and see if it's
> >> > appropriate for Android (if someone could do the same for iOS, that'd
> >> > be cool): https://github.com/lite4mobi/Cordova-SQLitePlugin
> >> >
> >> > I think this looks far more promising than any of the hokey bullshit
> >> > that we're currently doing, and it has contributors, and it's actually
> >> > updated for Cordova 3.0.
> >> >
> >> > On Thu, Sep 19, 2013 at 7:53 AM, Ian Clelland <iclelland@chromium.org
> >
> >> > wrote:
> >> > > On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com>
> >> > > wrote:
> >> > >
> >> > >> OK, here's a crazy concept that I'm going to throw out there.
> >> > >>
> >> > >> How about we audit and recommend a third-party plugin and not do
> any
> >> > >> more work on this issue.
> >> > >
> >> > >
> >> > > +1
> >> > >
> >> > > I don't think there's enough consensus about whether WebSQL even
> >> > > belongs
> >> > in
> >> > > the web platform for us to be insisting that it be part of Cordova.
> I
> >> > would
> >> > > much rather see someone with a real interest in WebSQL be providing
> >> > > that
> >> > > functionality. Our job can be to make sure that we aren't getting in
> >> > > the
> >> > > way; that we are helping make plugins like that possible.
> >> > >
> >> > > Ian
> >> >
> >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Joe Bowser <bo...@gmail.com>.
OK, I tried the tests included with the plugin, and they don't run.
Can someone sanity check this for me?  I'm going to try running this
on additional devices, since it could be a weird Cyanogen thing.  But
yeah, if other people can try this plugin, that'd be awesome.

On Thu, Sep 19, 2013 at 10:12 AM, Andrew Grieve <ag...@chromium.org> wrote:
> Tried out my email code, and despite my confidence, it doesn't work :P.
>
> So... Joe - like your plan.
>
>
> On Thu, Sep 19, 2013 at 12:32 PM, Brian LeRoux <b...@brian.io> wrote:
>>
>> yup.
>>
>>
>> On Thu, Sep 19, 2013 at 5:42 PM, Joe Bowser <bo...@gmail.com> wrote:
>>
>> > OK, how about we do this:
>> >
>> > 1. We indicate that we no longer support WebSQL on the docs and we
>> > list out why we don't support it as it currently exists
>> > 2. I'll look at the Android plugin that does do SQLite and see if it's
>> > appropriate for Android (if someone could do the same for iOS, that'd
>> > be cool): https://github.com/lite4mobi/Cordova-SQLitePlugin
>> >
>> > I think this looks far more promising than any of the hokey bullshit
>> > that we're currently doing, and it has contributors, and it's actually
>> > updated for Cordova 3.0.
>> >
>> > On Thu, Sep 19, 2013 at 7:53 AM, Ian Clelland <ic...@chromium.org>
>> > wrote:
>> > > On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com>
>> > > wrote:
>> > >
>> > >> OK, here's a crazy concept that I'm going to throw out there.
>> > >>
>> > >> How about we audit and recommend a third-party plugin and not do any
>> > >> more work on this issue.
>> > >
>> > >
>> > > +1
>> > >
>> > > I don't think there's enough consensus about whether WebSQL even
>> > > belongs
>> > in
>> > > the web platform for us to be insisting that it be part of Cordova. I
>> > would
>> > > much rather see someone with a real interest in WebSQL be providing
>> > > that
>> > > functionality. Our job can be to make sure that we aren't getting in
>> > > the
>> > > way; that we are helping make plugins like that possible.
>> > >
>> > > Ian
>> >
>
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Andrew Grieve <ag...@chromium.org>.
Tried out my email code, and despite my confidence, it doesn't work :P.

So... Joe - like your plan.


On Thu, Sep 19, 2013 at 12:32 PM, Brian LeRoux <b...@brian.io> wrote:

> yup.
>
>
> On Thu, Sep 19, 2013 at 5:42 PM, Joe Bowser <bo...@gmail.com> wrote:
>
> > OK, how about we do this:
> >
> > 1. We indicate that we no longer support WebSQL on the docs and we
> > list out why we don't support it as it currently exists
> > 2. I'll look at the Android plugin that does do SQLite and see if it's
> > appropriate for Android (if someone could do the same for iOS, that'd
> > be cool): https://github.com/lite4mobi/Cordova-SQLitePlugin
> >
> > I think this looks far more promising than any of the hokey bullshit
> > that we're currently doing, and it has contributors, and it's actually
> > updated for Cordova 3.0.
> >
> > On Thu, Sep 19, 2013 at 7:53 AM, Ian Clelland <ic...@chromium.org>
> > wrote:
> > > On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com>
> wrote:
> > >
> > >> OK, here's a crazy concept that I'm going to throw out there.
> > >>
> > >> How about we audit and recommend a third-party plugin and not do any
> > >> more work on this issue.
> > >
> > >
> > > +1
> > >
> > > I don't think there's enough consensus about whether WebSQL even
> belongs
> > in
> > > the web platform for us to be insisting that it be part of Cordova. I
> > would
> > > much rather see someone with a real interest in WebSQL be providing
> that
> > > functionality. Our job can be to make sure that we aren't getting in
> the
> > > way; that we are helping make plugins like that possible.
> > >
> > > Ian
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Brian LeRoux <b...@brian.io>.
yup.


On Thu, Sep 19, 2013 at 5:42 PM, Joe Bowser <bo...@gmail.com> wrote:

> OK, how about we do this:
>
> 1. We indicate that we no longer support WebSQL on the docs and we
> list out why we don't support it as it currently exists
> 2. I'll look at the Android plugin that does do SQLite and see if it's
> appropriate for Android (if someone could do the same for iOS, that'd
> be cool): https://github.com/lite4mobi/Cordova-SQLitePlugin
>
> I think this looks far more promising than any of the hokey bullshit
> that we're currently doing, and it has contributors, and it's actually
> updated for Cordova 3.0.
>
> On Thu, Sep 19, 2013 at 7:53 AM, Ian Clelland <ic...@chromium.org>
> wrote:
> > On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com> wrote:
> >
> >> OK, here's a crazy concept that I'm going to throw out there.
> >>
> >> How about we audit and recommend a third-party plugin and not do any
> >> more work on this issue.
> >
> >
> > +1
> >
> > I don't think there's enough consensus about whether WebSQL even belongs
> in
> > the web platform for us to be insisting that it be part of Cordova. I
> would
> > much rather see someone with a real interest in WebSQL be providing that
> > functionality. Our job can be to make sure that we aren't getting in the
> > way; that we are helping make plugins like that possible.
> >
> > Ian
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Joe Bowser <bo...@gmail.com>.
OK, how about we do this:

1. We indicate that we no longer support WebSQL on the docs and we
list out why we don't support it as it currently exists
2. I'll look at the Android plugin that does do SQLite and see if it's
appropriate for Android (if someone could do the same for iOS, that'd
be cool): https://github.com/lite4mobi/Cordova-SQLitePlugin

I think this looks far more promising than any of the hokey bullshit
that we're currently doing, and it has contributors, and it's actually
updated for Cordova 3.0.

On Thu, Sep 19, 2013 at 7:53 AM, Ian Clelland <ic...@chromium.org> wrote:
> On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com> wrote:
>
>> OK, here's a crazy concept that I'm going to throw out there.
>>
>> How about we audit and recommend a third-party plugin and not do any
>> more work on this issue.
>
>
> +1
>
> I don't think there's enough consensus about whether WebSQL even belongs in
> the web platform for us to be insisting that it be part of Cordova. I would
> much rather see someone with a real interest in WebSQL be providing that
> functionality. Our job can be to make sure that we aren't getting in the
> way; that we are helping make plugins like that possible.
>
> Ian

Re: [Android] The state of WebSQL on Android 4.x

Posted by Ian Clelland <ic...@chromium.org>.
On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com> wrote:

> OK, here's a crazy concept that I'm going to throw out there.
>
> How about we audit and recommend a third-party plugin and not do any
> more work on this issue.


+1

I don't think there's enough consensus about whether WebSQL even belongs in
the web platform for us to be insisting that it be part of Cordova. I would
much rather see someone with a real interest in WebSQL be providing that
functionality. Our job can be to make sure that we aren't getting in the
way; that we are helping make plugins like that possible.

Ian

RE: [Android] The state of WebSQL on Android 4.x

Posted by "Parashuram Narasimhan (MS OPEN TECH)" <pa...@microsoft.com>.
I wrote a IndexedDB Shim that works on WebSQL and I am aware that there are some bugs I need to fix. I am also in the process of converting the IndexedDB shim into a Cordova plugin. However, with iOS7, the size of IndexedDB is still smaller (5MB). Any help with fixing the plugin bugs would be appreciated. 

Alternatively, Windows Phone does support SQLite and we could simply carve out a SQLite plugin that has a webSQL like API across platforms. 

-----Original Message-----
From: mmocny@google.com [mailto:mmocny@google.com] On Behalf Of Michal Mocny
Sent: Thursday, September 19, 2013 7:49 AM
To: dev; bowserj@apache.org
Cc: Braden Shepherdson
Subject: Re: [Android] The state of WebSQL on Android 4.x

+1 to not reinventing the wheel and sanctioning external contributions 
+if
they are available, Joe.

Having said that, personally I'd prefer to see an IndexedDB-like-thing instead of a WebSQL-like-thing since thats the direction all desktop browsers have gone, and maps better to web developer expectations/abilities.  Also, there is hope that one day mobile webviews will support IndexedDB and we can remove our polyfills, and the reverse is not true, so I think an IDB polyfill aligns better with cordova goals.

-Michal


On Thu, Sep 19, 2013 at 7:38 AM, Joe Bowser <bo...@gmail.com> wrote:

> OK, here's a crazy concept that I'm going to throw out there.
>
> How about we audit and recommend a third-party plugin and not do any 
> more work on this issue.  I know that Android has a SQLite plugin that 
> works like WebSQL, but has a slightly different namespace. I haven't 
> recommended it because I don't feel comfortable doing that not knowing 
> how good it works.  Then once we give our rubber stamp on that plugin, 
> we let our current solutions go on the ice flows to die.
>
> What do people think of that idea?  I'd rather not re-invent the wheel 
> if I don't have to.
>
> On Thu, Sep 19, 2013 at 7:30 AM, Braden Shepherdson 
> <br...@chromium.org>
> wrote:
> > The troubling part here is that WebSQL is broken (iOS7 introduced 
> > new
> bugs,
> > too!) on iOS and Android, not supported on non-Webkit browsers, and crap.
> > But... IndexedDB is arguably more crap, though less buggy, but it 
> > isn't supported on /anything/ mobile to my knowledge. This has been 
> > a crippling problem when our chrome-apps-on-cordova team has been 
> > porting apps. If
> some
> > app uses IndexedDB, we're out of luck.
> >
> > There is a shim that uses WebSQL as a back-end for IndexedDB, 
> > intended
> to be
> > used on these devices. But then it's still crap and buggy. I started
> poking
> > at it to see if I could replace this with a shim of IndexedDB with a
> Cordova
> > plugin (maybe File, more likely something specialized) as the backend.
> > That's probably possible, though it was complicated in a couple of
> places by
> > the fact that some IDB/WebSQL calls are sync but all Cordova native 
> > calls are async. Probably still possible to do that port, if we 
> > think it's worthwhile. It would be a nontrivial project, though, and 
> > the IDB
> interface
> > and performance still suck.
> >
> > Braden
> >
> >
> >
> >
> > On Thu, Sep 19, 2013 at 8:08 AM, Brian LeRoux <b...@brian.io> wrote:
> >>
> >> Deprecated.
> >> On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:
> >>
> >> > If it's easy to support, then I think it's worth doing.
> >> >
> >> > A custom scheme would work, but I think we can do it with a less 
> >> > intrusive
> >> > change:
> >> >
> >> > We came up with the following hack during our 
> >> > chrome-apps-on-cordova work for having CORS work when on a custom 
> >> > scheme. Should work for WebSQL
> as
> >> > well though. It takes advantage of the fact that file:/// pages 
> >> > can access window objects of opened windows that are on different 
> >> > domains. It
> goes
> >> > like:
> >> >
> >> > The JS Code:
> >> >
> >> > var win = window.open("websql://ftw"); // wait for window to 
> >> > load. Maybe via onload event? Or via polling?
> >> > win.onload = function() {
> >> >   window.openDatabase = win.openDatabase; }
> >> >
> >> >
> >> > // The Java code:
> >> > app.getSettings().setSupportMultipleWindows(true);
> >> >
> >> > // In Chrome Client:
> >> >     @SuppressWarnings("unused")
> >> >     private WebView newWebView = null;
> >> >     public boolean onCreateWindow (WebView view, boolean 
> >> > isDialog, boolean isUserGesture, Message resultMsg) {
> >> >         WebView.WebViewTransport transport =
> (WebView.WebViewTransport)
> >> > resultMsg.obj;
> >> >         newWebView = new WebView(act);
> >> >         newWebView.getSettings().setJavaScriptEnabled(true);
> >> >
> >> >         newWebView.setWebViewClient(new WebViewClient(){
> >> >                 @Override
> >> >                 public WebResourceResponse
> shouldInterceptRequest(final
> >> > WebView view, String url) {
> >> >                         return a response that is just an empty page.
> >> >                 }
> >> >         });
> >> > transport.setWebView(newWebView);
> >> >         resultMsg.sendToTarget();
> >> >         return true;
> >> >     }
> >> >
> >> >
> >> > On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com>
> wrote:
> >> >
> >> > > Windows Phone has never supported it.  I have always felt that 
> >> > > this
> is
> >> > more
> >> > > of a browser responsibility and didn't belong in the 'phonegap 
> >> > > features'
> >> > > matrix. Just like we don't list querySelectorAll or SVG support.
> >> > >
> >> > > Someone needs to write a JS shim that uses the File API which 
> >> > > IS
> >> > available
> >> > > on all the devices in cordova.
> >> > >
> >> > > @purplecabbage
> >> > > risingj.com
> >> > >
> >> > >
> >> > > On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com>
> wrote:
> >> > >
> >> > > > Ok, We've been ignoring this for quite a while, but it's not 
> >> > > > going
> >> > away:
> >> > > >
> >> > > > There's still people who want to use WebSQL, and WebSQL is 
> >> > > > still totally broken.  Part of the reason it's broken is the 
> >> > > > fact that Android prevents us from using the official WebSQL 
> >> > > > API on file
> URIs,
> >> > > > and that we have a nasty collision with the official API on
> Android.
> >> > > >
> >> > > > So, what should we do?
> >> > > > 1. Use a custom URI scheme?
> >> > > > 2. Fix the JS so it aliases the existing WebSQL, and keep 
> >> > > > using
> our
> >> > > > own WebSQL plugin.
> >> > > > 3. Just say it's deprecated and leave it at that?
> >> > > >
> >> > > > If we say we're tossing WebSQL by the wayside, what do we 
> >> > > > support instead?  Seriously, what do people think of this, 
> >> > > > because I'm not sure what we should do here.
> >> > > >
> >> > > > Joe
> >> > > >
> >> > >
> >> >
> >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Michal Mocny <mm...@chromium.org>.
+1 to not reinventing the wheel and sanctioning external contributions if
they are available, Joe.

Having said that, personally I'd prefer to see an IndexedDB-like-thing
instead of a WebSQL-like-thing since thats the direction all desktop
browsers have gone, and maps better to web developer
expectations/abilities.  Also, there is hope that one day mobile webviews
will support IndexedDB and we can remove our polyfills, and the reverse is
not true, so I think an IDB polyfill aligns better with cordova goals.

-Michal


On Thu, Sep 19, 2013 at 7:38 AM, Joe Bowser <bo...@gmail.com> wrote:

> OK, here's a crazy concept that I'm going to throw out there.
>
> How about we audit and recommend a third-party plugin and not do any
> more work on this issue.  I know that Android has a SQLite plugin that
> works like WebSQL, but has a slightly different namespace. I haven't
> recommended it because I don't feel comfortable doing that not knowing
> how good it works.  Then once we give our rubber stamp on that plugin,
> we let our current solutions go on the ice flows to die.
>
> What do people think of that idea?  I'd rather not re-invent the wheel
> if I don't have to.
>
> On Thu, Sep 19, 2013 at 7:30 AM, Braden Shepherdson <br...@chromium.org>
> wrote:
> > The troubling part here is that WebSQL is broken (iOS7 introduced new
> bugs,
> > too!) on iOS and Android, not supported on non-Webkit browsers, and crap.
> > But... IndexedDB is arguably more crap, though less buggy, but it isn't
> > supported on /anything/ mobile to my knowledge. This has been a crippling
> > problem when our chrome-apps-on-cordova team has been porting apps. If
> some
> > app uses IndexedDB, we're out of luck.
> >
> > There is a shim that uses WebSQL as a back-end for IndexedDB, intended
> to be
> > used on these devices. But then it's still crap and buggy. I started
> poking
> > at it to see if I could replace this with a shim of IndexedDB with a
> Cordova
> > plugin (maybe File, more likely something specialized) as the backend.
> > That's probably possible, though it was complicated in a couple of
> places by
> > the fact that some IDB/WebSQL calls are sync but all Cordova native calls
> > are async. Probably still possible to do that port, if we think it's
> > worthwhile. It would be a nontrivial project, though, and the IDB
> interface
> > and performance still suck.
> >
> > Braden
> >
> >
> >
> >
> > On Thu, Sep 19, 2013 at 8:08 AM, Brian LeRoux <b...@brian.io> wrote:
> >>
> >> Deprecated.
> >> On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:
> >>
> >> > If it's easy to support, then I think it's worth doing.
> >> >
> >> > A custom scheme would work, but I think we can do it with a less
> >> > intrusive
> >> > change:
> >> >
> >> > We came up with the following hack during our chrome-apps-on-cordova
> >> > work
> >> > for having CORS work when on a custom scheme. Should work for WebSQL
> as
> >> > well though. It takes advantage of the fact that file:/// pages can
> >> > access
> >> > window objects of opened windows that are on different domains. It
> goes
> >> > like:
> >> >
> >> > The JS Code:
> >> >
> >> > var win = window.open("websql://ftw");
> >> > // wait for window to load. Maybe via onload event? Or via polling?
> >> > win.onload = function() {
> >> >   window.openDatabase = win.openDatabase;
> >> > }
> >> >
> >> >
> >> > // The Java code:
> >> > app.getSettings().setSupportMultipleWindows(true);
> >> >
> >> > // In Chrome Client:
> >> >     @SuppressWarnings("unused")
> >> >     private WebView newWebView = null;
> >> >     public boolean onCreateWindow (WebView view, boolean isDialog,
> >> > boolean
> >> > isUserGesture, Message resultMsg) {
> >> >         WebView.WebViewTransport transport =
> (WebView.WebViewTransport)
> >> > resultMsg.obj;
> >> >         newWebView = new WebView(act);
> >> >         newWebView.getSettings().setJavaScriptEnabled(true);
> >> >
> >> >         newWebView.setWebViewClient(new WebViewClient(){
> >> >                 @Override
> >> >                 public WebResourceResponse
> shouldInterceptRequest(final
> >> > WebView view, String url) {
> >> >                         return a response that is just an empty page.
> >> >                 }
> >> >         });
> >> > transport.setWebView(newWebView);
> >> >         resultMsg.sendToTarget();
> >> >         return true;
> >> >     }
> >> >
> >> >
> >> > On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com>
> wrote:
> >> >
> >> > > Windows Phone has never supported it.  I have always felt that this
> is
> >> > more
> >> > > of a browser responsibility and didn't belong in the 'phonegap
> >> > > features'
> >> > > matrix. Just like we don't list querySelectorAll or SVG support.
> >> > >
> >> > > Someone needs to write a JS shim that uses the File API which IS
> >> > available
> >> > > on all the devices in cordova.
> >> > >
> >> > > @purplecabbage
> >> > > risingj.com
> >> > >
> >> > >
> >> > > On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com>
> wrote:
> >> > >
> >> > > > Ok, We've been ignoring this for quite a while, but it's not going
> >> > away:
> >> > > >
> >> > > > There's still people who want to use WebSQL, and WebSQL is still
> >> > > > totally broken.  Part of the reason it's broken is the fact that
> >> > > > Android prevents us from using the official WebSQL API on file
> URIs,
> >> > > > and that we have a nasty collision with the official API on
> Android.
> >> > > >
> >> > > > So, what should we do?
> >> > > > 1. Use a custom URI scheme?
> >> > > > 2. Fix the JS so it aliases the existing WebSQL, and keep using
> our
> >> > > > own WebSQL plugin.
> >> > > > 3. Just say it's deprecated and leave it at that?
> >> > > >
> >> > > > If we say we're tossing WebSQL by the wayside, what do we support
> >> > > > instead?  Seriously, what do people think of this, because I'm not
> >> > > > sure what we should do here.
> >> > > >
> >> > > > Joe
> >> > > >
> >> > >
> >> >
> >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Andrew Grieve <ag...@chromium.org>.
Although WebSQL is deprecated, it's what's currently available in mobile
browsers, so having it enables people to write apps that work on the web as
well as within a Cordova shell.

Let me paste my email code into actual Cordova and see if it works.

Having a plugin that provides a DB that works across all platforms would be
great as well.


On Thu, Sep 19, 2013 at 10:38 AM, Joe Bowser <bo...@gmail.com> wrote:

> OK, here's a crazy concept that I'm going to throw out there.
>
> How about we audit and recommend a third-party plugin and not do any
> more work on this issue.  I know that Android has a SQLite plugin that
> works like WebSQL, but has a slightly different namespace. I haven't
> recommended it because I don't feel comfortable doing that not knowing
> how good it works.  Then once we give our rubber stamp on that plugin,
> we let our current solutions go on the ice flows to die.
>
> What do people think of that idea?  I'd rather not re-invent the wheel
> if I don't have to.
>
> On Thu, Sep 19, 2013 at 7:30 AM, Braden Shepherdson <br...@chromium.org>
> wrote:
> > The troubling part here is that WebSQL is broken (iOS7 introduced new
> bugs,
> > too!) on iOS and Android, not supported on non-Webkit browsers, and crap.
> > But... IndexedDB is arguably more crap, though less buggy, but it isn't
> > supported on /anything/ mobile to my knowledge. This has been a crippling
> > problem when our chrome-apps-on-cordova team has been porting apps. If
> some
> > app uses IndexedDB, we're out of luck.
> >
> > There is a shim that uses WebSQL as a back-end for IndexedDB, intended
> to be
> > used on these devices. But then it's still crap and buggy. I started
> poking
> > at it to see if I could replace this with a shim of IndexedDB with a
> Cordova
> > plugin (maybe File, more likely something specialized) as the backend.
> > That's probably possible, though it was complicated in a couple of
> places by
> > the fact that some IDB/WebSQL calls are sync but all Cordova native calls
> > are async. Probably still possible to do that port, if we think it's
> > worthwhile. It would be a nontrivial project, though, and the IDB
> interface
> > and performance still suck.
> >
> > Braden
> >
> >
> >
> >
> > On Thu, Sep 19, 2013 at 8:08 AM, Brian LeRoux <b...@brian.io> wrote:
> >>
> >> Deprecated.
> >> On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:
> >>
> >> > If it's easy to support, then I think it's worth doing.
> >> >
> >> > A custom scheme would work, but I think we can do it with a less
> >> > intrusive
> >> > change:
> >> >
> >> > We came up with the following hack during our chrome-apps-on-cordova
> >> > work
> >> > for having CORS work when on a custom scheme. Should work for WebSQL
> as
> >> > well though. It takes advantage of the fact that file:/// pages can
> >> > access
> >> > window objects of opened windows that are on different domains. It
> goes
> >> > like:
> >> >
> >> > The JS Code:
> >> >
> >> > var win = window.open("websql://ftw");
> >> > // wait for window to load. Maybe via onload event? Or via polling?
> >> > win.onload = function() {
> >> >   window.openDatabase = win.openDatabase;
> >> > }
> >> >
> >> >
> >> > // The Java code:
> >> > app.getSettings().setSupportMultipleWindows(true);
> >> >
> >> > // In Chrome Client:
> >> >     @SuppressWarnings("unused")
> >> >     private WebView newWebView = null;
> >> >     public boolean onCreateWindow (WebView view, boolean isDialog,
> >> > boolean
> >> > isUserGesture, Message resultMsg) {
> >> >         WebView.WebViewTransport transport =
> (WebView.WebViewTransport)
> >> > resultMsg.obj;
> >> >         newWebView = new WebView(act);
> >> >         newWebView.getSettings().setJavaScriptEnabled(true);
> >> >
> >> >         newWebView.setWebViewClient(new WebViewClient(){
> >> >                 @Override
> >> >                 public WebResourceResponse
> shouldInterceptRequest(final
> >> > WebView view, String url) {
> >> >                         return a response that is just an empty page.
> >> >                 }
> >> >         });
> >> > transport.setWebView(newWebView);
> >> >         resultMsg.sendToTarget();
> >> >         return true;
> >> >     }
> >> >
> >> >
> >> > On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com>
> wrote:
> >> >
> >> > > Windows Phone has never supported it.  I have always felt that this
> is
> >> > more
> >> > > of a browser responsibility and didn't belong in the 'phonegap
> >> > > features'
> >> > > matrix. Just like we don't list querySelectorAll or SVG support.
> >> > >
> >> > > Someone needs to write a JS shim that uses the File API which IS
> >> > available
> >> > > on all the devices in cordova.
> >> > >
> >> > > @purplecabbage
> >> > > risingj.com
> >> > >
> >> > >
> >> > > On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com>
> wrote:
> >> > >
> >> > > > Ok, We've been ignoring this for quite a while, but it's not going
> >> > away:
> >> > > >
> >> > > > There's still people who want to use WebSQL, and WebSQL is still
> >> > > > totally broken.  Part of the reason it's broken is the fact that
> >> > > > Android prevents us from using the official WebSQL API on file
> URIs,
> >> > > > and that we have a nasty collision with the official API on
> Android.
> >> > > >
> >> > > > So, what should we do?
> >> > > > 1. Use a custom URI scheme?
> >> > > > 2. Fix the JS so it aliases the existing WebSQL, and keep using
> our
> >> > > > own WebSQL plugin.
> >> > > > 3. Just say it's deprecated and leave it at that?
> >> > > >
> >> > > > If we say we're tossing WebSQL by the wayside, what do we support
> >> > > > instead?  Seriously, what do people think of this, because I'm not
> >> > > > sure what we should do here.
> >> > > >
> >> > > > Joe
> >> > > >
> >> > >
> >> >
> >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Brian LeRoux <b...@brian.io>.
Thats fine by me. We should not care if the w3c and browsers are moving in
a different direction anyhow.


On Thu, Sep 19, 2013 at 4:38 PM, Joe Bowser <bo...@gmail.com> wrote:

> OK, here's a crazy concept that I'm going to throw out there.
>
> How about we audit and recommend a third-party plugin and not do any
> more work on this issue.  I know that Android has a SQLite plugin that
> works like WebSQL, but has a slightly different namespace. I haven't
> recommended it because I don't feel comfortable doing that not knowing
> how good it works.  Then once we give our rubber stamp on that plugin,
> we let our current solutions go on the ice flows to die.
>
> What do people think of that idea?  I'd rather not re-invent the wheel
> if I don't have to.
>
> On Thu, Sep 19, 2013 at 7:30 AM, Braden Shepherdson <br...@chromium.org>
> wrote:
> > The troubling part here is that WebSQL is broken (iOS7 introduced new
> bugs,
> > too!) on iOS and Android, not supported on non-Webkit browsers, and crap.
> > But... IndexedDB is arguably more crap, though less buggy, but it isn't
> > supported on /anything/ mobile to my knowledge. This has been a crippling
> > problem when our chrome-apps-on-cordova team has been porting apps. If
> some
> > app uses IndexedDB, we're out of luck.
> >
> > There is a shim that uses WebSQL as a back-end for IndexedDB, intended
> to be
> > used on these devices. But then it's still crap and buggy. I started
> poking
> > at it to see if I could replace this with a shim of IndexedDB with a
> Cordova
> > plugin (maybe File, more likely something specialized) as the backend.
> > That's probably possible, though it was complicated in a couple of
> places by
> > the fact that some IDB/WebSQL calls are sync but all Cordova native calls
> > are async. Probably still possible to do that port, if we think it's
> > worthwhile. It would be a nontrivial project, though, and the IDB
> interface
> > and performance still suck.
> >
> > Braden
> >
> >
> >
> >
> > On Thu, Sep 19, 2013 at 8:08 AM, Brian LeRoux <b...@brian.io> wrote:
> >>
> >> Deprecated.
> >> On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:
> >>
> >> > If it's easy to support, then I think it's worth doing.
> >> >
> >> > A custom scheme would work, but I think we can do it with a less
> >> > intrusive
> >> > change:
> >> >
> >> > We came up with the following hack during our chrome-apps-on-cordova
> >> > work
> >> > for having CORS work when on a custom scheme. Should work for WebSQL
> as
> >> > well though. It takes advantage of the fact that file:/// pages can
> >> > access
> >> > window objects of opened windows that are on different domains. It
> goes
> >> > like:
> >> >
> >> > The JS Code:
> >> >
> >> > var win = window.open("websql://ftw");
> >> > // wait for window to load. Maybe via onload event? Or via polling?
> >> > win.onload = function() {
> >> >   window.openDatabase = win.openDatabase;
> >> > }
> >> >
> >> >
> >> > // The Java code:
> >> > app.getSettings().setSupportMultipleWindows(true);
> >> >
> >> > // In Chrome Client:
> >> >     @SuppressWarnings("unused")
> >> >     private WebView newWebView = null;
> >> >     public boolean onCreateWindow (WebView view, boolean isDialog,
> >> > boolean
> >> > isUserGesture, Message resultMsg) {
> >> >         WebView.WebViewTransport transport =
> (WebView.WebViewTransport)
> >> > resultMsg.obj;
> >> >         newWebView = new WebView(act);
> >> >         newWebView.getSettings().setJavaScriptEnabled(true);
> >> >
> >> >         newWebView.setWebViewClient(new WebViewClient(){
> >> >                 @Override
> >> >                 public WebResourceResponse
> shouldInterceptRequest(final
> >> > WebView view, String url) {
> >> >                         return a response that is just an empty page.
> >> >                 }
> >> >         });
> >> > transport.setWebView(newWebView);
> >> >         resultMsg.sendToTarget();
> >> >         return true;
> >> >     }
> >> >
> >> >
> >> > On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com>
> wrote:
> >> >
> >> > > Windows Phone has never supported it.  I have always felt that this
> is
> >> > more
> >> > > of a browser responsibility and didn't belong in the 'phonegap
> >> > > features'
> >> > > matrix. Just like we don't list querySelectorAll or SVG support.
> >> > >
> >> > > Someone needs to write a JS shim that uses the File API which IS
> >> > available
> >> > > on all the devices in cordova.
> >> > >
> >> > > @purplecabbage
> >> > > risingj.com
> >> > >
> >> > >
> >> > > On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com>
> wrote:
> >> > >
> >> > > > Ok, We've been ignoring this for quite a while, but it's not going
> >> > away:
> >> > > >
> >> > > > There's still people who want to use WebSQL, and WebSQL is still
> >> > > > totally broken.  Part of the reason it's broken is the fact that
> >> > > > Android prevents us from using the official WebSQL API on file
> URIs,
> >> > > > and that we have a nasty collision with the official API on
> Android.
> >> > > >
> >> > > > So, what should we do?
> >> > > > 1. Use a custom URI scheme?
> >> > > > 2. Fix the JS so it aliases the existing WebSQL, and keep using
> our
> >> > > > own WebSQL plugin.
> >> > > > 3. Just say it's deprecated and leave it at that?
> >> > > >
> >> > > > If we say we're tossing WebSQL by the wayside, what do we support
> >> > > > instead?  Seriously, what do people think of this, because I'm not
> >> > > > sure what we should do here.
> >> > > >
> >> > > > Joe
> >> > > >
> >> > >
> >> >
> >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Joe Bowser <bo...@gmail.com>.
OK, here's a crazy concept that I'm going to throw out there.

How about we audit and recommend a third-party plugin and not do any
more work on this issue.  I know that Android has a SQLite plugin that
works like WebSQL, but has a slightly different namespace. I haven't
recommended it because I don't feel comfortable doing that not knowing
how good it works.  Then once we give our rubber stamp on that plugin,
we let our current solutions go on the ice flows to die.

What do people think of that idea?  I'd rather not re-invent the wheel
if I don't have to.

On Thu, Sep 19, 2013 at 7:30 AM, Braden Shepherdson <br...@chromium.org> wrote:
> The troubling part here is that WebSQL is broken (iOS7 introduced new bugs,
> too!) on iOS and Android, not supported on non-Webkit browsers, and crap.
> But... IndexedDB is arguably more crap, though less buggy, but it isn't
> supported on /anything/ mobile to my knowledge. This has been a crippling
> problem when our chrome-apps-on-cordova team has been porting apps. If some
> app uses IndexedDB, we're out of luck.
>
> There is a shim that uses WebSQL as a back-end for IndexedDB, intended to be
> used on these devices. But then it's still crap and buggy. I started poking
> at it to see if I could replace this with a shim of IndexedDB with a Cordova
> plugin (maybe File, more likely something specialized) as the backend.
> That's probably possible, though it was complicated in a couple of places by
> the fact that some IDB/WebSQL calls are sync but all Cordova native calls
> are async. Probably still possible to do that port, if we think it's
> worthwhile. It would be a nontrivial project, though, and the IDB interface
> and performance still suck.
>
> Braden
>
>
>
>
> On Thu, Sep 19, 2013 at 8:08 AM, Brian LeRoux <b...@brian.io> wrote:
>>
>> Deprecated.
>> On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:
>>
>> > If it's easy to support, then I think it's worth doing.
>> >
>> > A custom scheme would work, but I think we can do it with a less
>> > intrusive
>> > change:
>> >
>> > We came up with the following hack during our chrome-apps-on-cordova
>> > work
>> > for having CORS work when on a custom scheme. Should work for WebSQL as
>> > well though. It takes advantage of the fact that file:/// pages can
>> > access
>> > window objects of opened windows that are on different domains. It goes
>> > like:
>> >
>> > The JS Code:
>> >
>> > var win = window.open("websql://ftw");
>> > // wait for window to load. Maybe via onload event? Or via polling?
>> > win.onload = function() {
>> >   window.openDatabase = win.openDatabase;
>> > }
>> >
>> >
>> > // The Java code:
>> > app.getSettings().setSupportMultipleWindows(true);
>> >
>> > // In Chrome Client:
>> >     @SuppressWarnings("unused")
>> >     private WebView newWebView = null;
>> >     public boolean onCreateWindow (WebView view, boolean isDialog,
>> > boolean
>> > isUserGesture, Message resultMsg) {
>> >         WebView.WebViewTransport transport = (WebView.WebViewTransport)
>> > resultMsg.obj;
>> >         newWebView = new WebView(act);
>> >         newWebView.getSettings().setJavaScriptEnabled(true);
>> >
>> >         newWebView.setWebViewClient(new WebViewClient(){
>> >                 @Override
>> >                 public WebResourceResponse shouldInterceptRequest(final
>> > WebView view, String url) {
>> >                         return a response that is just an empty page.
>> >                 }
>> >         });
>> > transport.setWebView(newWebView);
>> >         resultMsg.sendToTarget();
>> >         return true;
>> >     }
>> >
>> >
>> > On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com> wrote:
>> >
>> > > Windows Phone has never supported it.  I have always felt that this is
>> > more
>> > > of a browser responsibility and didn't belong in the 'phonegap
>> > > features'
>> > > matrix. Just like we don't list querySelectorAll or SVG support.
>> > >
>> > > Someone needs to write a JS shim that uses the File API which IS
>> > available
>> > > on all the devices in cordova.
>> > >
>> > > @purplecabbage
>> > > risingj.com
>> > >
>> > >
>> > > On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com> wrote:
>> > >
>> > > > Ok, We've been ignoring this for quite a while, but it's not going
>> > away:
>> > > >
>> > > > There's still people who want to use WebSQL, and WebSQL is still
>> > > > totally broken.  Part of the reason it's broken is the fact that
>> > > > Android prevents us from using the official WebSQL API on file URIs,
>> > > > and that we have a nasty collision with the official API on Android.
>> > > >
>> > > > So, what should we do?
>> > > > 1. Use a custom URI scheme?
>> > > > 2. Fix the JS so it aliases the existing WebSQL, and keep using our
>> > > > own WebSQL plugin.
>> > > > 3. Just say it's deprecated and leave it at that?
>> > > >
>> > > > If we say we're tossing WebSQL by the wayside, what do we support
>> > > > instead?  Seriously, what do people think of this, because I'm not
>> > > > sure what we should do here.
>> > > >
>> > > > Joe
>> > > >
>> > >
>> >
>
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by purplecabbage <pu...@gmail.com>.
wp8 and windows8 support indexed db. Bb10 has partial support. 

Sent from my iPhone

> On Sep 19, 2013, at 7:30 AM, Braden Shepherdson <br...@chromium.org> wrote:
> 
> The troubling part here is that WebSQL is broken (iOS7 introduced new bugs,
> too!) on iOS and Android, not supported on non-Webkit browsers, and crap.
> But... IndexedDB is arguably more crap, though less buggy, but it isn't
> supported on /anything/ mobile to my knowledge. This has been a crippling
> problem when our chrome-apps-on-cordova team has been porting apps. If some
> app uses IndexedDB, we're out of luck.
> 
> There is a shim that uses WebSQL as a back-end for IndexedDB, intended to
> be used on these devices. But then it's still crap and buggy. I started
> poking at it to see if I could replace this with a shim of IndexedDB with a
> Cordova plugin (maybe File, more likely something specialized) as the
> backend. That's probably possible, though it was complicated in a couple of
> places by the fact that some IDB/WebSQL calls are sync but all Cordova
> native calls are async. Probably still possible to do that port, if we
> think it's worthwhile. It would be a nontrivial project, though, and the
> IDB interface and performance still suck.
> 
> Braden
> 
> 
> 
> 
>> On Thu, Sep 19, 2013 at 8:08 AM, Brian LeRoux <b...@brian.io> wrote:
>> 
>> Deprecated.
>>> On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:
>>> 
>>> If it's easy to support, then I think it's worth doing.
>>> 
>>> A custom scheme would work, but I think we can do it with a less
>> intrusive
>>> change:
>>> 
>>> We came up with the following hack during our chrome-apps-on-cordova work
>>> for having CORS work when on a custom scheme. Should work for WebSQL as
>>> well though. It takes advantage of the fact that file:/// pages can
>> access
>>> window objects of opened windows that are on different domains. It goes
>>> like:
>>> 
>>> The JS Code:
>>> 
>>> var win = window.open("websql://ftw");
>>> // wait for window to load. Maybe via onload event? Or via polling?
>>> win.onload = function() {
>>>  window.openDatabase = win.openDatabase;
>>> }
>>> 
>>> 
>>> // The Java code:
>>> app.getSettings().setSupportMultipleWindows(true);
>>> 
>>> // In Chrome Client:
>>>    @SuppressWarnings("unused")
>>>    private WebView newWebView = null;
>>>    public boolean onCreateWindow (WebView view, boolean isDialog,
>> boolean
>>> isUserGesture, Message resultMsg) {
>>>        WebView.WebViewTransport transport = (WebView.WebViewTransport)
>>> resultMsg.obj;
>>>        newWebView = new WebView(act);
>>>        newWebView.getSettings().setJavaScriptEnabled(true);
>>> 
>>>        newWebView.setWebViewClient(new WebViewClient(){
>>>                @Override
>>>                public WebResourceResponse shouldInterceptRequest(final
>>> WebView view, String url) {
>>>                        return a response that is just an empty page.
>>>                }
>>>        });
>>> transport.setWebView(newWebView);
>>>        resultMsg.sendToTarget();
>>>        return true;
>>>    }
>>> 
>>> 
>>>> On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com> wrote:
>>>> 
>>>> Windows Phone has never supported it.  I have always felt that this is
>>> more
>>>> of a browser responsibility and didn't belong in the 'phonegap
>> features'
>>>> matrix. Just like we don't list querySelectorAll or SVG support.
>>>> 
>>>> Someone needs to write a JS shim that uses the File API which IS
>>> available
>>>> on all the devices in cordova.
>>>> 
>>>> @purplecabbage
>>>> risingj.com
>>>> 
>>>> 
>>>>> On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com> wrote:
>>>>> 
>>>>> Ok, We've been ignoring this for quite a while, but it's not going
>>> away:
>>>>> 
>>>>> There's still people who want to use WebSQL, and WebSQL is still
>>>>> totally broken.  Part of the reason it's broken is the fact that
>>>>> Android prevents us from using the official WebSQL API on file URIs,
>>>>> and that we have a nasty collision with the official API on Android.
>>>>> 
>>>>> So, what should we do?
>>>>> 1. Use a custom URI scheme?
>>>>> 2. Fix the JS so it aliases the existing WebSQL, and keep using our
>>>>> own WebSQL plugin.
>>>>> 3. Just say it's deprecated and leave it at that?
>>>>> 
>>>>> If we say we're tossing WebSQL by the wayside, what do we support
>>>>> instead?  Seriously, what do people think of this, because I'm not
>>>>> sure what we should do here.
>>>>> 
>>>>> Joe
>> 

Re: [Android] The state of WebSQL on Android 4.x

Posted by Braden Shepherdson <br...@chromium.org>.
The troubling part here is that WebSQL is broken (iOS7 introduced new bugs,
too!) on iOS and Android, not supported on non-Webkit browsers, and crap.
But... IndexedDB is arguably more crap, though less buggy, but it isn't
supported on /anything/ mobile to my knowledge. This has been a crippling
problem when our chrome-apps-on-cordova team has been porting apps. If some
app uses IndexedDB, we're out of luck.

There is a shim that uses WebSQL as a back-end for IndexedDB, intended to
be used on these devices. But then it's still crap and buggy. I started
poking at it to see if I could replace this with a shim of IndexedDB with a
Cordova plugin (maybe File, more likely something specialized) as the
backend. That's probably possible, though it was complicated in a couple of
places by the fact that some IDB/WebSQL calls are sync but all Cordova
native calls are async. Probably still possible to do that port, if we
think it's worthwhile. It would be a nontrivial project, though, and the
IDB interface and performance still suck.

Braden




On Thu, Sep 19, 2013 at 8:08 AM, Brian LeRoux <b...@brian.io> wrote:

> Deprecated.
> On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:
>
> > If it's easy to support, then I think it's worth doing.
> >
> > A custom scheme would work, but I think we can do it with a less
> intrusive
> > change:
> >
> > We came up with the following hack during our chrome-apps-on-cordova work
> > for having CORS work when on a custom scheme. Should work for WebSQL as
> > well though. It takes advantage of the fact that file:/// pages can
> access
> > window objects of opened windows that are on different domains. It goes
> > like:
> >
> > The JS Code:
> >
> > var win = window.open("websql://ftw");
> > // wait for window to load. Maybe via onload event? Or via polling?
> > win.onload = function() {
> >   window.openDatabase = win.openDatabase;
> > }
> >
> >
> > // The Java code:
> > app.getSettings().setSupportMultipleWindows(true);
> >
> > // In Chrome Client:
> >     @SuppressWarnings("unused")
> >     private WebView newWebView = null;
> >     public boolean onCreateWindow (WebView view, boolean isDialog,
> boolean
> > isUserGesture, Message resultMsg) {
> >         WebView.WebViewTransport transport = (WebView.WebViewTransport)
> > resultMsg.obj;
> >         newWebView = new WebView(act);
> >         newWebView.getSettings().setJavaScriptEnabled(true);
> >
> >         newWebView.setWebViewClient(new WebViewClient(){
> >                 @Override
> >                 public WebResourceResponse shouldInterceptRequest(final
> > WebView view, String url) {
> >                         return a response that is just an empty page.
> >                 }
> >         });
> > transport.setWebView(newWebView);
> >         resultMsg.sendToTarget();
> >         return true;
> >     }
> >
> >
> > On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com> wrote:
> >
> > > Windows Phone has never supported it.  I have always felt that this is
> > more
> > > of a browser responsibility and didn't belong in the 'phonegap
> features'
> > > matrix. Just like we don't list querySelectorAll or SVG support.
> > >
> > > Someone needs to write a JS shim that uses the File API which IS
> > available
> > > on all the devices in cordova.
> > >
> > > @purplecabbage
> > > risingj.com
> > >
> > >
> > > On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com> wrote:
> > >
> > > > Ok, We've been ignoring this for quite a while, but it's not going
> > away:
> > > >
> > > > There's still people who want to use WebSQL, and WebSQL is still
> > > > totally broken.  Part of the reason it's broken is the fact that
> > > > Android prevents us from using the official WebSQL API on file URIs,
> > > > and that we have a nasty collision with the official API on Android.
> > > >
> > > > So, what should we do?
> > > > 1. Use a custom URI scheme?
> > > > 2. Fix the JS so it aliases the existing WebSQL, and keep using our
> > > > own WebSQL plugin.
> > > > 3. Just say it's deprecated and leave it at that?
> > > >
> > > > If we say we're tossing WebSQL by the wayside, what do we support
> > > > instead?  Seriously, what do people think of this, because I'm not
> > > > sure what we should do here.
> > > >
> > > > Joe
> > > >
> > >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Brian LeRoux <b...@brian.io>.
Deprecated.
On Sep 19, 2013 5:04 AM, "Andrew Grieve" <ag...@chromium.org> wrote:

> If it's easy to support, then I think it's worth doing.
>
> A custom scheme would work, but I think we can do it with a less intrusive
> change:
>
> We came up with the following hack during our chrome-apps-on-cordova work
> for having CORS work when on a custom scheme. Should work for WebSQL as
> well though. It takes advantage of the fact that file:/// pages can access
> window objects of opened windows that are on different domains. It goes
> like:
>
> The JS Code:
>
> var win = window.open("websql://ftw");
> // wait for window to load. Maybe via onload event? Or via polling?
> win.onload = function() {
>   window.openDatabase = win.openDatabase;
> }
>
>
> // The Java code:
> app.getSettings().setSupportMultipleWindows(true);
>
> // In Chrome Client:
>     @SuppressWarnings("unused")
>     private WebView newWebView = null;
>     public boolean onCreateWindow (WebView view, boolean isDialog, boolean
> isUserGesture, Message resultMsg) {
>         WebView.WebViewTransport transport = (WebView.WebViewTransport)
> resultMsg.obj;
>         newWebView = new WebView(act);
>         newWebView.getSettings().setJavaScriptEnabled(true);
>
>         newWebView.setWebViewClient(new WebViewClient(){
>                 @Override
>                 public WebResourceResponse shouldInterceptRequest(final
> WebView view, String url) {
>                         return a response that is just an empty page.
>                 }
>         });
> transport.setWebView(newWebView);
>         resultMsg.sendToTarget();
>         return true;
>     }
>
>
> On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com> wrote:
>
> > Windows Phone has never supported it.  I have always felt that this is
> more
> > of a browser responsibility and didn't belong in the 'phonegap features'
> > matrix. Just like we don't list querySelectorAll or SVG support.
> >
> > Someone needs to write a JS shim that uses the File API which IS
> available
> > on all the devices in cordova.
> >
> > @purplecabbage
> > risingj.com
> >
> >
> > On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com> wrote:
> >
> > > Ok, We've been ignoring this for quite a while, but it's not going
> away:
> > >
> > > There's still people who want to use WebSQL, and WebSQL is still
> > > totally broken.  Part of the reason it's broken is the fact that
> > > Android prevents us from using the official WebSQL API on file URIs,
> > > and that we have a nasty collision with the official API on Android.
> > >
> > > So, what should we do?
> > > 1. Use a custom URI scheme?
> > > 2. Fix the JS so it aliases the existing WebSQL, and keep using our
> > > own WebSQL plugin.
> > > 3. Just say it's deprecated and leave it at that?
> > >
> > > If we say we're tossing WebSQL by the wayside, what do we support
> > > instead?  Seriously, what do people think of this, because I'm not
> > > sure what we should do here.
> > >
> > > Joe
> > >
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Andrew Grieve <ag...@chromium.org>.
If it's easy to support, then I think it's worth doing.

A custom scheme would work, but I think we can do it with a less intrusive
change:

We came up with the following hack during our chrome-apps-on-cordova work
for having CORS work when on a custom scheme. Should work for WebSQL as
well though. It takes advantage of the fact that file:/// pages can access
window objects of opened windows that are on different domains. It goes
like:

The JS Code:

var win = window.open("websql://ftw");
// wait for window to load. Maybe via onload event? Or via polling?
win.onload = function() {
  window.openDatabase = win.openDatabase;
}


// The Java code:
app.getSettings().setSupportMultipleWindows(true);

// In Chrome Client:
    @SuppressWarnings("unused")
    private WebView newWebView = null;
    public boolean onCreateWindow (WebView view, boolean isDialog, boolean
isUserGesture, Message resultMsg) {
        WebView.WebViewTransport transport = (WebView.WebViewTransport)
resultMsg.obj;
        newWebView = new WebView(act);
        newWebView.getSettings().setJavaScriptEnabled(true);

        newWebView.setWebViewClient(new WebViewClient(){
                @Override
                public WebResourceResponse shouldInterceptRequest(final
WebView view, String url) {
                        return a response that is just an empty page.
                }
        });
transport.setWebView(newWebView);
        resultMsg.sendToTarget();
        return true;
    }


On Wed, Sep 18, 2013 at 7:43 PM, Jesse <pu...@gmail.com> wrote:

> Windows Phone has never supported it.  I have always felt that this is more
> of a browser responsibility and didn't belong in the 'phonegap features'
> matrix. Just like we don't list querySelectorAll or SVG support.
>
> Someone needs to write a JS shim that uses the File API which IS available
> on all the devices in cordova.
>
> @purplecabbage
> risingj.com
>
>
> On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com> wrote:
>
> > Ok, We've been ignoring this for quite a while, but it's not going away:
> >
> > There's still people who want to use WebSQL, and WebSQL is still
> > totally broken.  Part of the reason it's broken is the fact that
> > Android prevents us from using the official WebSQL API on file URIs,
> > and that we have a nasty collision with the official API on Android.
> >
> > So, what should we do?
> > 1. Use a custom URI scheme?
> > 2. Fix the JS so it aliases the existing WebSQL, and keep using our
> > own WebSQL plugin.
> > 3. Just say it's deprecated and leave it at that?
> >
> > If we say we're tossing WebSQL by the wayside, what do we support
> > instead?  Seriously, what do people think of this, because I'm not
> > sure what we should do here.
> >
> > Joe
> >
>

Re: [Android] The state of WebSQL on Android 4.x

Posted by Jesse <pu...@gmail.com>.
Windows Phone has never supported it.  I have always felt that this is more
of a browser responsibility and didn't belong in the 'phonegap features'
matrix. Just like we don't list querySelectorAll or SVG support.

Someone needs to write a JS shim that uses the File API which IS available
on all the devices in cordova.

@purplecabbage
risingj.com


On Wed, Sep 18, 2013 at 2:31 PM, Joe Bowser <bo...@gmail.com> wrote:

> Ok, We've been ignoring this for quite a while, but it's not going away:
>
> There's still people who want to use WebSQL, and WebSQL is still
> totally broken.  Part of the reason it's broken is the fact that
> Android prevents us from using the official WebSQL API on file URIs,
> and that we have a nasty collision with the official API on Android.
>
> So, what should we do?
> 1. Use a custom URI scheme?
> 2. Fix the JS so it aliases the existing WebSQL, and keep using our
> own WebSQL plugin.
> 3. Just say it's deprecated and leave it at that?
>
> If we say we're tossing WebSQL by the wayside, what do we support
> instead?  Seriously, what do people think of this, because I'm not
> sure what we should do here.
>
> Joe
>