mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
16 lines
488 B
C++
16 lines
488 B
C++
#include "weburlrequestinterceptor.h"
|
|
#include <QDebug>
|
|
#include "utils.hh"
|
|
|
|
WebUrlRequestInterceptor::WebUrlRequestInterceptor(QObject *p)
|
|
:QWebEngineUrlRequestInterceptor(p)
|
|
{
|
|
|
|
}
|
|
void WebUrlRequestInterceptor::interceptRequest( QWebEngineUrlRequestInfo &info) {
|
|
if (QWebEngineUrlRequestInfo::NavigationTypeLink == info.navigationType() && info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeMainFrame) {
|
|
emit linkClicked(info.requestUrl());
|
|
info.block(true);
|
|
}
|
|
}
|