1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-22 02:02:10 +02:00

Don't show error page when there are some data received. See #155

- should fix this issue
This commit is contained in:
nowrep 2012-01-13 21:04:40 +01:00
parent d848d5621d
commit 1436a1f21a

View File

@ -304,6 +304,11 @@ bool WebPage::extension(Extension extension, const ExtensionOption* option, Exte
const ErrorPageExtensionOption* exOption = static_cast<const QWebPage::ErrorPageExtensionOption*>(option);
ErrorPageExtensionReturn* exReturn = static_cast<QWebPage::ErrorPageExtensionReturn*>(output);
WebPage* erPage = qobject_cast<WebPage*>(exOption->frame->page());
if (erPage->bytesReceived() != 0) {
return QWebPage::extension(extension, option, output);
}
QString errorString;
if (exOption->domain == QWebPage::QtNetwork) {
@ -325,8 +330,8 @@ bool WebPage::extension(Extension extension, const ExtensionOption* option, Exte
break;
case QNetworkReply::ContentAccessDenied:
if (exOption->errorString.startsWith("AdBlockRule")) {
if (exOption->frame != exOption->frame->page()->mainFrame()) { //Content in <iframe>
QWebElement docElement = exOption->frame->page()->mainFrame()->documentElement();
if (exOption->frame != erPage->mainFrame()) { //Content in <iframe>
QWebElement docElement = erPage->mainFrame()->documentElement();
QWebElementCollection elements;
elements.append(docElement.findAll("iframe"));