mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Don't show error page when there are some data received. See #155
- should fix this issue
This commit is contained in:
parent
d848d5621d
commit
1436a1f21a
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue
Block a user