mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
parent
bd75853929
commit
fc17444438
@ -26,7 +26,10 @@ GM_UrlInterceptor::GM_UrlInterceptor(GM_Manager *manager)
|
|||||||
|
|
||||||
void GM_UrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
|
void GM_UrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
|
||||||
{
|
{
|
||||||
if (info.navigationType() != QWebEngineUrlRequestInfo::NavigationTypeLink)
|
bool xhr = info.resourceType() == QWebEngineUrlRequestInfo::ResourceTypeXhr;
|
||||||
|
bool clickedLink = info.navigationType() == QWebEngineUrlRequestInfo::NavigationTypeLink;
|
||||||
|
|
||||||
|
if (xhr || !clickedLink)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (info.requestUrl().toString().endsWith(QLatin1String(".user.js"))) {
|
if (info.requestUrl().toString().endsWith(QLatin1String(".user.js"))) {
|
||||||
@ -34,3 +37,4 @@ void GM_UrlInterceptor::interceptRequest(QWebEngineUrlRequestInfo &info)
|
|||||||
info.block(true);
|
info.block(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user