简体   繁体   中英

How to enable HTML client-side SQL database in embedded webkit app (test app on github)

I've got a super simple little OS X app with a minimal embedded webkit view that needs client-side SQL database support enabled. I've put the test app up on github but just can't get the client-side storage working.

I'm using Xcode v3.2.3 with the WebKit framework it provides, but have also tried using the webkit nightly without luck.

I'm setting the preferences via a 'web' outlet:

WebPreferences *prefs = [web preferences];
[prefs _setLocalStorageDatabasePath:@"/tmp"];
[prefs _setLocalStorageDatabasePath:@"/tmp"];
[prefs setDatabasesEnabled:YES];
[prefs setLocalStorageEnabled:YES];
[prefs setDeveloperExtrasEnabled:YES];

If anyone could fork the app on github or point out what else I need to be doing, it'd be very much appreciated :)

Local databases should be done with a javascript you run in the HTML, HTML5 Databases tutorial

You could also try using sqlLite in your app, or core data but I think you want to access it through your HTML?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM