PDA

View Full Version : Webkit and Client Side Storage



bythos
6th January 2010, 14:11
Hello people.

I been having trouble getting the client side storage working with webkit.

Here is code i'm using can anyone see what i'm doing wrong?


QApplication::setApplicationName(TEXTAPPLICATION);

QApplication::setApplicationVersion(TEXTAPPVERSION );

QApplication::setOrganizationName(TEXTORG);

QApplication::setOrganizationDomain(TEXTORGDOMAIN) ;

QSettings settings;

QWebSettings::enablePersistentStorage(TEXTDATAPATH );

QWebSettings::setOfflineStorageDefaultQuota(MAXQUO TA);

QWebSettings::setOfflineWebApplicationCacheQuota(M AXQUOTA);

QString url = "http://webkit.org/demos/sticky-notes/index.html";

ui->setupUi(this);

this->setWindowTitle(TEXTAPPLICATION); //set application windows title

ui->webView->settings()->globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);

ui->webView->settings()->globalSettings()->setAttribute(QWebSettings::LocalContentCanAccessRe moteUrls, true);

ui->webView->settings()->globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true);

ui->webView->settings()->globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseE nabled, true);

ui->webView->setUrl(url);




I worked out that i'm getting this error in the inspector.

INVALID_STATE_ERR: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.

Seems to have something to do with window.openDatabase()

Jick
4th March 2010, 10:22
I'm having the same issue. I get that exact error in the inspector. I can't figure it out... Could it be a bug in Qt? Because it works just fine in Safari.

tihi
23rd June 2010, 14:37
I know it's been a while since this question was posted.. I had the same issue and there is very little information about this error around web.
Indeed, error happens when calling openDatabase within JS and I managed to eliminate it with


QWebSettings::globalSettings()->setOfflineStoragePath("/some/writable/path/here");