use bit better place to use UA
This commit is contained in:
		
							parent
							
								
									d001ca6378
								
							
						
					
					
						commit
						465c0d81e1
					
				
					 2 changed files with 2 additions and 3 deletions
				
			
		|  | @ -101,6 +101,8 @@ Application::Application(const QString& id, int& argc, char** argv) | ||||||
| #if defined(USE_WEBENGINE) | #if defined(USE_WEBENGINE) | ||||||
|   m_webFactory->urlIinterceptor()->load(); |   m_webFactory->urlIinterceptor()->load(); | ||||||
| 
 | 
 | ||||||
|  |   QWebEngineProfile::defaultProfile()->setHttpUserAgent(QString(HTTP_COMPLETE_USERAGENT)); | ||||||
|  | 
 | ||||||
|   connect(QWebEngineProfile::defaultProfile(), &QWebEngineProfile::downloadRequested, this, &Application::downloadRequested); |   connect(QWebEngineProfile::defaultProfile(), &QWebEngineProfile::downloadRequested, this, &Application::downloadRequested); | ||||||
|   connect(m_webFactory->adBlock(), &AdBlockManager::processTerminated, this, &Application::onAdBlockFailure); |   connect(m_webFactory->adBlock(), &AdBlockManager::processTerminated, this, &Application::onAdBlockFailure); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -35,9 +35,6 @@ void NetworkUrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo& info) { | ||||||
| 
 | 
 | ||||||
|   // NOTE: Here we can add custom headers for each webengine request, for example "User-Agent".
 |   // 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)) { |   for (UrlInterceptor* interceptor : qAsConst(m_interceptors)) { | ||||||
|     interceptor->interceptRequest(info); |     interceptor->interceptRequest(info); | ||||||
|   } |   } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue