The openDatabase () method throws an exception (SECURITY_ERR: DOM 18 exception)

The openDatabase () method throws an exception ( SECURITY_ERR: DOM Exception 18 ) on iPad 4.3, as well as on all 4.x iOS simulators when the database size is specified by more than 5 MB.

Compiling under Xcode 4.2 (Mac OS X 10.6.8) using PhoneGap 1.0.0.

Is there a way around this limitation?

Here is a sample code:

<!DOCTYPE html> <html> <head> <script src="phonegap-1.0.0.js"></script> <script> try { var db = window.openDatabase("TMA", "1.0", "TMA Mobile Database", 1024 * 1024 * 10); } catch (err) { alert(err); } </script> <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> </head> <body> </body> </html> 
+4
source share
1 answer

According to this resource, the maximum size imposed by iOS itself is 5 MB. As soon as it reaches 5 MB, it will ask the user if he wants him to become larger.

I doubt there is a good way around.

Have you tried to create multiple databases? You might be running two 5 MB databases for you.

+2
source

All Articles