diff --git a/CHANGELOG b/CHANGELOG index 294213f9f..4bcd06250 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ Version 1.4.0 * option to disable alt/ctrl + numbers shortcuts * option to switch to tab from locationbar popup completer * use .qupzilla/tmp instead of /tmp for temporary data + * fixed loading NYTimes skimmer page * fixed cookie domain handling according to RFC 6265 * fixed qvalue format in Accept-Language HTTP header * fixed sorting files case insensitively in file scheme handler diff --git a/src/lib/webview/webpage.cpp b/src/lib/webview/webpage.cpp index fb287e6cb..c81a2fcf0 100644 --- a/src/lib/webview/webpage.cpp +++ b/src/lib/webview/webpage.cpp @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -58,6 +58,7 @@ #include #include #include +#include QString WebPage::s_lastUploadLocation = QDir::homePath(); QUrl WebPage::s_lastUnsupportedUrl; @@ -92,12 +93,26 @@ WebPage::WebPage(QupZilla* mainClass) connect(this, SIGNAL(downloadRequested(QNetworkRequest)), this, SLOT(downloadRequested(QNetworkRequest))); connect(this, SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested())); + connect(this, SIGNAL(databaseQuotaExceeded(QWebFrame*, QString)), + this, SLOT(dbQuotaExceeded(QWebFrame*))); + connect(mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addJavaScriptObject())); #if QTWEBKIT_FROM_2_2 - connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), this, SLOT(featurePermissionRequested(QWebFrame*, QWebPage::Feature))); + connect(this, SIGNAL(featurePermissionRequested(QWebFrame*, QWebPage::Feature)), + this, SLOT(featurePermissionRequested(QWebFrame*, QWebPage::Feature))); #endif +#if QTWEBKIT_FROM_2_3 + connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*, quint64, quint64)), + this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*, quint64))); +#else + connect(this, SIGNAL(applicationCacheQuotaExceeded(QWebSecurityOrigin*, quint64)), + this, SLOT(appCacheQuotaExceeded(QWebSecurityOrigin*, quint64))); + +#endif + + s_livingPages.append(this); } @@ -392,6 +407,27 @@ void WebPage::windowCloseRequested() webView->closeView(); } +void WebPage::dbQuotaExceeded(QWebFrame* frame) +{ + if (!frame) { + return; + } + + const QWebSecurityOrigin &origin = frame->securityOrigin(); + const qint64 oldQuota = origin.databaseQuota(); + + frame->securityOrigin().setDatabaseQuota(oldQuota * 2); +} + +void WebPage::appCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 originalQuota) +{ + if (!origin) { + return; + } + + origin->setApplicationCacheQuota(originalQuota * 2); +} + #if QTWEBKIT_FROM_2_2 void WebPage::featurePermissionRequested(QWebFrame* frame, const QWebPage::Feature &feature) { @@ -504,7 +540,8 @@ QWebPage* WebPage::createWindow(QWebPage::WebWindowType type) return new PopupWebPage(type, p_QupZilla); } -QObject* WebPage::createPlugin(const QString &classid, const QUrl &url, const QStringList ¶mNames, const QStringList ¶mValues) +QObject* WebPage::createPlugin(const QString &classid, const QUrl &url, + const QStringList ¶mNames, const QStringList ¶mValues) { Q_UNUSED(url) Q_UNUSED(paramNames) diff --git a/src/lib/webview/webpage.h b/src/lib/webview/webpage.h index 4818d660b..9e6892d21 100644 --- a/src/lib/webview/webpage.h +++ b/src/lib/webview/webpage.h @@ -1,6 +1,6 @@ /* ============================================================ * QupZilla - WebKit based browser -* Copyright (C) 2010-2012 David Rosca +* Copyright (C) 2010-2013 David Rosca * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -96,6 +96,9 @@ private slots: void downloadRequested(const QNetworkRequest &request); void windowCloseRequested(); + void dbQuotaExceeded(QWebFrame* frame); + void appCacheQuotaExceeded(QWebSecurityOrigin* origin, quint64 originalQuota); + #ifdef USE_QTWEBKIT_2_2 void featurePermissionRequested(QWebFrame* frame, const QWebPage::Feature &feature); #endif