2021-12-11 16:34:37 +00:00
|
|
|
#include "weburlrequestinterceptor.h"
|
|
|
|
#include <QDebug>
|
2021-12-29 15:28:26 +00:00
|
|
|
#include "utils.hh"
|
2021-12-11 16:34:37 +00:00
|
|
|
|
|
|
|
WebUrlRequestInterceptor::WebUrlRequestInterceptor(QObject *p)
|
|
|
|
:QWebEngineUrlRequestInterceptor(p)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2021-12-31 14:11:55 +00:00
|
|
|
void WebUrlRequestInterceptor::interceptRequest( QWebEngineUrlRequestInfo &info) {
|
|
|
|
if (QWebEngineUrlRequestInfo::NavigationTypeLink == info.navigationType() && info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
|
2021-12-29 15:28:26 +00:00
|
|
|
emit linkClicked(info.requestUrl());
|
2021-12-31 14:11:55 +00:00
|
|
|
|
|
|
|
info.block(true);
|
2021-12-29 15:28:26 +00:00
|
|
|
}
|
2021-12-11 16:34:37 +00:00
|
|
|
}
|