Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

openDatabase error at Safari 7

I have the following code in my application:

openDatabase('main', '1.0', 'Database display name', 50 * 1024 * 1024)

It worked fine until Apple introduced Safari 7. Now it fails with the following exception:

SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.

Does anybody know how it can be solved?

like image 835
Marat Faskhiev Avatar asked Oct 21 '13 04:10

Marat Faskhiev


1 Answers

I found an answer. Hope it will be useful for someone else:

http://www.mobilexweb.com/blog/safari-ios7-html5-problems-apis-review

WebSQL bug •Using WebSQL API will have big issues (DOMException) while trying to create a database bigger than 5Mb. On previous versions, the limit was 50Mb with user’s permission. Because of a bug, when you try to store more than 5Mb the user will get a permission dialog but just for 5Mb only. Even if the user grants you permission because it’s for 5Mb only, you will get an exception trying to get more. It’s a BIG BUG.

Update 19/9: According to tarobomb from New York Times, if you request less than 5Mb when you first create the database and then you try to store more data (up to 50Mb) the proper confirmation dialog will appear (first 10Mb, then 25Mb and finally 50Mb) and you will finally be able to store more than 5Mb.

like image 105
Marat Faskhiev Avatar answered Oct 11 '22 18:10

Marat Faskhiev