Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityError DOM Exception 18 on Safari for iOS on iPad #4234

Closed
deliriousrhino opened this issue Aug 31, 2015 · 8 comments
Closed

SecurityError DOM Exception 18 on Safari for iOS on iPad #4234

deliriousrhino opened this issue Aug 31, 2015 · 8 comments

Comments

@deliriousrhino
Copy link

Security Error on Safari on IPad iOS 8.3 and 8.4
Looks like it is the same as this one but for safari
#3382

I created a very simple plunker which recreates the issue.
http://plnkr.co/edit/s9zZqHj9ECsvKh21cRS0?p=preview

Thanks in advance.
Ryan

@nolanlawson
Copy link
Member

Can you provide some more detail? Is it a website or an app? What are you doing to cause the error? Can you provide a screenshot?

@nolanlawson
Copy link
Member

DOM Exception 18 usually means you exceeded the quota allowed on the device (50MB), although in some environments it's because Apple removed WebSQL support (e.g. WKWebView).

@deliriousrhino
Copy link
Author

Its a website. If I run the plunker which is very simple I get the error. http://plnkr.co/edit/s9zZqHj9ECsvKh21cRS0?p=preview

This is the only custom code it contains

new PouchDB('localPouchName', {
                    size: 1000
                }).then(function(){
                   console.log('database created')
                }).catch(function(err){
                    console.log('Error created database',err)
                });

So if I am asking for more storage than the device has I may get this error?
I don't have the devices with me but can lower the size and re test later today.

@nolanlawson
Copy link
Member

Yep, so the size is in MB (see http://pouchdb.com/errors.html#not_enough_space), so if you try to request 1000MB (i.e. 1GB) on iOS, it will definitely throw an error because you are only allowed to have 50MB max. (Desktop Safari allows you to have more, but not iOS.)

@deliriousrhino
Copy link
Author

Yes the safari 50mb limit was causing the error.
Changing to size 50 fixed the problem. Thanks

new PouchDB('localPouchName', {
                    size: 50
                }).then(function(){
                   console.log('database created')
                }).catch(function(err){
                    console.log('Error created database',err)
                });

@soitgoes
Copy link

soitgoes commented Apr 25, 2016

I'm getting this error even if I specify {size:50} on version 5.3.2.

For the WKWebView what is the suggested workaround?

@nolanlawson
Copy link
Member

WKWebView does not support WebSQL at all. It's an open bug on WebKit. Here's a brief rundown of options: #5079

@soitgoes
Copy link

Thanks so much for the speedy response!

On Mon, Apr 25, 2016 at 4:36 PM, Nolan Lawson notifications@github.com
wrote:

WKWebView does not support WebSQL at all. It's an open bug on WebKit.
Here's a brief rundown of options: #5079
#5079


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#4234 (comment)

Martin Murphy
Whiteboard-IT
http://whiteboard-it.com
w: (205) 588-7102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants