add error logs in browser web view

preferencesAboutTextFull
Clément Fauconnier 6 years ago
parent bcf18abfd9
commit d70ad72cc4
  1. 27
      src/web/browser/WBWebView.h

@ -95,6 +95,33 @@ class WBWebPage : public UBWebPage
QWebPage *createWindow(QWebPage::WebWindowType type); QWebPage *createWindow(QWebPage::WebWindowType type);
QObject *createPlugin(const QString &classId, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues); QObject *createPlugin(const QString &classId, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
bool supportsExtension(Extension extension) const {
if (extension == QWebPage::ErrorPageExtension)
{
return true;
}
return false;
}
bool extension(Extension extension, const ExtensionOption *option = 0, ExtensionReturn *output = 0)
{
if (extension != QWebPage::ErrorPageExtension)
return false;
ErrorPageExtensionOption *errorOption = (ErrorPageExtensionOption*) option;
qDebug() << "Error loading " << qPrintable(errorOption->url.toString());
if(errorOption->domain == QWebPage::QtNetwork)
qDebug() << "Network error (" << errorOption->error << "): ";
else if(errorOption->domain == QWebPage::Http)
qDebug() << "HTTP error (" << errorOption->error << "): ";
else if(errorOption->domain == QWebPage::WebKit)
qDebug() << "WebKit error (" << errorOption->error << "): ";
qDebug() << qPrintable(errorOption->errorString);
return false;
}
private slots: private slots:
void handleUnsupportedContent(QNetworkReply *reply); void handleUnsupportedContent(QNetworkReply *reply);

Loading…
Cancel
Save