2013-10-21 10 views
5

Ho il seguente codice nella mia domanda:errore OpenDatabase al Safari 7

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

ha funzionato bene fino a quando Apple ha introdotto Safari 7. Ora non riesce con la seguente eccezione:

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

Qualcuno sapere come può essere risolto?

risposta

5

Ho trovato una risposta. Spero che sarà utile per qualcun altro:

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.

0

ho figgured che out.When si entra safari, un piccolo pulsante in alto a sinistra della tastiera dice "privato", fare clic per disattivare esso. Il database funzionerà bene, ma con le limitazioni menzionate da Marat. Ma (per gli utenti mobili di jQuery)! jquery mobile non sarà in grado di utilizzare il pulsante Indietro. Per questo, devi eliminare appcache dal tuo codice. jquerymobile 1.4 risolverà questo problema, ma per ora dovrai vivere senza appcache!

Problemi correlati