goldendict-ng/weburlrequestinterceptor.cpp

14 lines
442 B
C++
Raw Normal View History

2021-12-11 16:34:37 +00:00
#include "weburlrequestinterceptor.h"
#include <QDebug>
WebUrlRequestInterceptor::WebUrlRequestInterceptor(QObject *p)
:QWebEngineUrlRequestInterceptor(p)
{
}
void WebUrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info) {
if(QWebEngineUrlRequestInfo::NavigationTypeLink==info.navigationType ()&&info.resourceType ()==QWebEngineUrlRequestInfo::ResourceTypeMainFrame)
emit linkClicked(info.requestUrl ());
}