use bit better place to use UA

This commit is contained in:
Martin Rotter 2021-12-16 10:02:49 +01:00
parent d001ca6378
commit 465c0d81e1
2 changed files with 2 additions and 3 deletions

View File

@ -101,6 +101,8 @@ Application::Application(const QString& id, int& argc, char** argv)
#if defined(USE_WEBENGINE)
m_webFactory->urlIinterceptor()->load();
QWebEngineProfile::defaultProfile()->setHttpUserAgent(QString(HTTP_COMPLETE_USERAGENT));
connect(QWebEngineProfile::defaultProfile(), &QWebEngineProfile::downloadRequested, this, &Application::downloadRequested);
connect(m_webFactory->adBlock(), &AdBlockManager::processTerminated, this, &Application::onAdBlockFailure);

View File

@ -35,9 +35,6 @@ void NetworkUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo& info) {
// NOTE: Here we can add custom headers for each webengine request, for example "User-Agent".
info.setHttpHeader(QByteArrayLiteral(HTTP_HEADERS_USER_AGENT),
HTTP_COMPLETE_USERAGENT);
for (UrlInterceptor* interceptor : qAsConst(m_interceptors)) {
interceptor->interceptRequest(info);
}