mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
[AdBlock] Blocking netscape plugins even without C2F enabled.
Closes #791
This commit is contained in:
parent
ef89347a7c
commit
8bff746d30
|
@ -39,6 +39,7 @@ Version 1.4.0
|
||||||
* fixed sorting files case insensitively in file scheme handler
|
* fixed sorting files case insensitively in file scheme handler
|
||||||
* fixed possible crash in saving page screen of a really long page
|
* fixed possible crash in saving page screen of a really long page
|
||||||
* fixed showing window in fullscreen with XFCE
|
* fixed showing window in fullscreen with XFCE
|
||||||
|
* fixed AdBlock blocking netscape plugin even without Click2Flash
|
||||||
* X11: fixed Ctrl+Q shortcut for DEs other than KDE and Gnome
|
* X11: fixed Ctrl+Q shortcut for DEs other than KDE and Gnome
|
||||||
* windows: fixed color of found text when searching on page
|
* windows: fixed color of found text when searching on page
|
||||||
* windows: fixed navigating to file links and x: labels in file: scheme handler
|
* windows: fixed navigating to file links and x: labels in file: scheme handler
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
* QupZilla - WebKit based browser
|
* QupZilla - WebKit based browser
|
||||||
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
* Copyright (C) 2010-2013 David Rosca <nowrep@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -37,7 +37,15 @@ QObject* WebPluginFactory::create(const QString &mimeType, const QUrl &url, cons
|
||||||
return new QObject();
|
return new QObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString mime = mimeType.trimmed(); //Fixing bad behaviour when mimeType contains spaces
|
// AdBlock
|
||||||
|
AdBlockManager* manager = AdBlockManager::instance();
|
||||||
|
QNetworkRequest request(url);
|
||||||
|
request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 150), QString("object"));
|
||||||
|
if (manager->isEnabled() && manager->block(request)) {
|
||||||
|
return new QObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString mime = mimeType.trimmed(); // Fixing bad behaviour when mimeType contains spaces
|
||||||
if (mime.isEmpty()) {
|
if (mime.isEmpty()) {
|
||||||
if (url.toString().endsWith(QLatin1String(".swf"))) {
|
if (url.toString().endsWith(QLatin1String(".swf"))) {
|
||||||
mime = "application/x-shockwave-flash";
|
mime = "application/x-shockwave-flash";
|
||||||
|
@ -58,14 +66,6 @@ QObject* WebPluginFactory::create(const QString &mimeType, const QUrl &url, cons
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdBlock
|
|
||||||
AdBlockManager* manager = AdBlockManager::instance();
|
|
||||||
QNetworkRequest request(url);
|
|
||||||
request.setAttribute(QNetworkRequest::Attribute(QNetworkRequest::User + 150), QString("object"));
|
|
||||||
if (manager->isEnabled() && manager->block(request)) {
|
|
||||||
return new QObject();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Click2Flash whitelist
|
// Click2Flash whitelist
|
||||||
QStringList whitelist = mApp->plugins()->c2f_getWhiteList();
|
QStringList whitelist = mApp->plugins()->c2f_getWhiteList();
|
||||||
if (whitelist.contains(url.host()) || whitelist.contains("www." + url.host()) || whitelist.contains(url.host().remove(QLatin1String("www.")))) {
|
if (whitelist.contains(url.host()) || whitelist.contains("www." + url.host()) || whitelist.contains(url.host().remove(QLatin1String("www.")))) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user