1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Import FlashCookieManager plugin from qupzilla-plugins

This commit is contained in:
David Rosca 2015-01-21 12:58:45 +01:00
parent 04d4555b47
commit 2a9288209c
14 changed files with 2559 additions and 0 deletions

View File

@ -0,0 +1,28 @@
TARGET = $$qtLibraryTarget(FlashCookieManager)
os2: TARGET = FlashCoo
SOURCES += fcm_plugin.cpp \
fcm_dialog.cpp \
fcm_notification.cpp
HEADERS += fcm_plugin.h \
fcm_dialog.h \
fcm_notification.h
RESOURCES += flashcookiemanager.qrc
TRANSLATIONS += \
translations/fa_IR.ts
PLUGIN_DIR = $$PWD
srcdir = $$(QUPZILLA_SRCDIR)
equals(srcdir, "") {
include(../../plugins.pri)
}
else {
include($$srcdir/src/plugins.pri)
}
FORMS += \
fcm_dialog.ui \
fcm_notification.ui

View File

@ -0,0 +1,12 @@
FlashCookieManager extension for QupZilla
-------------------------------------------------
An extension to manage flash cookies.
![conf2](http://i.imgur.com/TGCG5ok.png)
You will find more information about the configuration and usage of this extension in the [wiki](https://github.com/QupZilla/qupzilla-plugins/wiki/Flash-Cookie-Manager).
**Links about flash cookie**
- [Local shared object] (http://en.wikipedia.org/wiki/Local_shared_object)
- [You Deleted Your Cookies? Think Again] (http://www.wired.com/2009/08/you-deleted-your-cookies-think-again/)

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -0,0 +1,452 @@
/* ============================================================
* FlashCookieManager plugin for QupZilla
* Copyright (C) 2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
*
* some codes and ideas are taken from cookiemanager.cpp and cookiemanager.ui
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "fcm_dialog.h"
#include "ui_fcm_dialog.h"
#include "qztools.h"
#include "iconprovider.h"
#include "fcm_plugin.h"
#include <QMessageBox>
#include <QShortcut>
#include <QTimer>
#include <QInputDialog>
#include <QCloseEvent>
#include <QMenu>
FCM_Dialog::FCM_Dialog(FCM_Plugin* manager, QWidget* parent)
: QDialog(parent, Qt::WindowStaysOnTopHint)
, ui(new Ui::FCM_Dialog)
, m_manager(manager)
{
ui->setupUi(this);
QzTools::centerWidgetOnScreen(this);
ui->path->hide();
ui->labelPath->hide();
if (isRightToLeft()) {
ui->flashCookieTree->headerItem()->setTextAlignment(0, Qt::AlignRight | Qt::AlignVCenter);
ui->flashCookieTree->setLayoutDirection(Qt::LeftToRight);
ui->whiteList->setLayoutDirection(Qt::LeftToRight);
ui->blackList->setLayoutDirection(Qt::LeftToRight);
}
connect(ui->flashCookieTree, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)));
connect(ui->removeAll, SIGNAL(clicked()), this, SLOT(removeAll()));
connect(ui->removeOne, SIGNAL(clicked()), this, SLOT(removeCookie()));
connect(ui->close, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close2, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->close3, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close()));
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
connect(ui->reloadFromDisk, SIGNAL(clicked()), this, SLOT(reloadFromDisk()));
connect(ui->whiteAdd, SIGNAL(clicked()), this, SLOT(addWhitelist()));
connect(ui->whiteRemove, SIGNAL(clicked()), this, SLOT(removeWhitelist()));
connect(ui->blackAdd, SIGNAL(clicked()), this, SLOT(addBlacklist()));
connect(ui->blackRemove, SIGNAL(clicked()), this, SLOT(removeBlacklist()));
connect(ui->autoMode, SIGNAL(toggled(bool)), ui->notification, SLOT(setEnabled(bool)));
connect(ui->autoMode, SIGNAL(toggled(bool)), ui->labelNotification, SLOT(setEnabled(bool)));
connect(ui->browseFlashDataPath, SIGNAL(clicked()), this, SLOT(selectFlashDataPath()));
ui->autoMode->setChecked(m_manager->readSettings().value(QL1S("autoMode")).toBool());
ui->notification->setEnabled(m_manager->readSettings().value(QL1S("autoMode")).toBool());
ui->notification->setChecked(m_manager->readSettings().value(QL1S("notification")).toBool());
ui->deleteAllOnStartExit->setChecked(m_manager->readSettings().value(QL1S("deleteAllOnStartExit")).toBool());
ui->flashDataPath->setText(m_manager->flashPlayerDataPath());
ui->labelNotification->setEnabled(ui->autoMode->isChecked());
ui->search->setPlaceholderText(tr("Search"));
ui->flashCookieTree->setDefaultItemShowMode(TreeWidget::ItemsCollapsed);
ui->flashCookieTree->sortItems(0, Qt::AscendingOrder);
ui->flashCookieTree->header()->setDefaultSectionSize(220);
ui->flashCookieTree->setFocus();
ui->flashCookieTree->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->flashCookieTree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(cookieTreeContextMenuRequested(QPoint)));
QShortcut* removeShortcut = new QShortcut(QKeySequence("Del"), this);
connect(removeShortcut, SIGNAL(activated()), this, SLOT(deletePressed()));
QzTools::setWmClass("FlashCookies", this);
}
void FCM_Dialog::removeAll()
{
QMessageBox::StandardButton button = QMessageBox::warning(this, tr("Confirmation"),
tr("Are you sure to delete all flash cookies on your computer?"), QMessageBox::Yes | QMessageBox::No);
if (button != QMessageBox::Yes) {
return;
}
const QList<FlashCookie> &flashCookies = m_manager->flashCookies();
foreach (const FlashCookie &flashCookie, flashCookies) {
m_manager->removeCookie(flashCookie);
}
ui->flashCookieTree->clear();
m_manager->clearNewOrigins();
m_manager->clearCache();
}
void FCM_Dialog::removeCookie()
{
QTreeWidgetItem* current = ui->flashCookieTree->currentItem();
if (!current) {
return;
}
const QVariant data = current->data(0, Qt::UserRole + 10);
if (data.isNull()) { //Remove whole cookie group
const QString origin = current->text(0);
const QList<FlashCookie> &flashCookies = m_manager->flashCookies();
foreach (const FlashCookie &flashCookie, flashCookies) {
if (flashCookie.origin == origin) {
m_manager->removeCookie(flashCookie);
}
}
ui->flashCookieTree->deleteItem(current);
}
else {
const FlashCookie flashCookie = qvariant_cast<FlashCookie>(data);
m_manager->removeCookie(flashCookie);
QTreeWidgetItem* parentItem = current->parent();
ui->flashCookieTree->deleteItem(current);
if (parentItem->childCount() == 0) {
ui->flashCookieTree->deleteItem(parentItem);
}
}
}
void FCM_Dialog::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* parent)
{
Q_UNUSED(parent);
if (!current) {
return;
}
ui->textEdit->clear();
const QVariant data = current->data(0, Qt::UserRole + 10);
if (data.isNull()) {
ui->name->setText(tr("<flash cookie not selected>"));
ui->size->setText(tr("<flash cookie not selected>"));
ui->server->setText(tr("<flash cookie not selected>"));
ui->lastModified->setText(tr("<flash cookie not selected>"));
ui->removeOne->setText(tr("Remove flash cookies"));
ui->path->hide();
ui->labelPath->hide();
return;
}
const FlashCookie flashCookie = qvariant_cast<FlashCookie>(data);
QString suffix;
if (flashCookie.path.startsWith(m_manager->flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys"))) {
suffix = tr(" (settings)");
}
ui->name->setText(flashCookie.name + suffix);
ui->size->setText(QString::number(flashCookie.size) + tr(" Byte"));
ui->textEdit->setPlainText(flashCookie.contents);
ui->server->setText(flashCookie.origin);
ui->path->setText(QString("<a href=\"%1\">%2</a>").arg(QUrl::fromLocalFile(flashCookie.path).toString()).arg(QDir::toNativeSeparators(flashCookie.path)));
ui->lastModified->setText(flashCookie.lastModification.toString());
ui->removeOne->setText(tr("Remove flash cookie"));
ui->labelPath->show();
ui->path->show();
}
void FCM_Dialog::refreshView(bool forceReload)
{
disconnect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
ui->search->clear();
ui->textEdit->clear();
connect(ui->search, SIGNAL(textChanged(QString)), this, SLOT(filterString(QString)));
if (forceReload) {
m_manager->clearCache();
m_manager->clearNewOrigins();
}
QTimer::singleShot(0, this, SLOT(refreshFlashCookiesTree()));
QTimer::singleShot(0, this, SLOT(refreshFilters()));
}
void FCM_Dialog::showPage(int index)
{
ui->tabWidget->setCurrentIndex(index);
}
void FCM_Dialog::refreshFlashCookiesTree()
{
const QList<FlashCookie> &flashCookies = m_manager->flashCookies();
QApplication::setOverrideCursor(Qt::WaitCursor);
ui->flashCookieTree->clear();
int counter = 0;
QPointer<FCM_Dialog> guard = this;
QHash<QString, QTreeWidgetItem*> hash;
for (int i = 0; i < flashCookies.count(); ++i) {
const FlashCookie flashCookie = flashCookies.at(i);
QTreeWidgetItem* item;
QString cookieOrigin = flashCookie.origin;
if (cookieOrigin.startsWith(QLatin1Char('.'))) {
cookieOrigin = cookieOrigin.mid(1);
}
QTreeWidgetItem* findParent = hash.value(cookieOrigin);
if (findParent) {
item = new QTreeWidgetItem(findParent);
}
else {
QTreeWidgetItem* newParent = new QTreeWidgetItem(ui->flashCookieTree);
newParent->setText(0, cookieOrigin);
newParent->setIcon(0, IconProvider::standardIcon(QStyle::SP_DirIcon));
ui->flashCookieTree->addTopLevelItem(newParent);
hash[cookieOrigin] = newParent;
item = new QTreeWidgetItem(newParent);
}
QString suffix;
if (flashCookie.path.startsWith(m_manager->flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys"))) {
suffix = tr(" (settings)");
}
if (m_manager->newCookiesList().contains(flashCookie.path + QL1C('/') + flashCookie.name)) {
suffix += tr(" [new]");
QFont font = item->font(0);
font.setBold(true);
item->setFont(0, font);
item->parent()->setExpanded(true);
}
item->setText(0, flashCookie.name + suffix);
item->setData(0, Qt::UserRole + 10, QVariant::fromValue(flashCookie));
ui->flashCookieTree->addTopLevelItem(item);
++counter;
if (counter > 200) {
QApplication::processEvents();
counter = 0;
}
if (!guard) {
break;
}
}
QApplication::restoreOverrideCursor();
}
void FCM_Dialog::refreshFilters()
{
ui->whiteList->clear();
ui->blackList->clear();
ui->whiteList->addItems(m_manager->readSettings().value(QL1S("flashCookiesWhitelist")).toStringList());
ui->blackList->addItems(m_manager->readSettings().value(QL1S("flashCookiesBlacklist")).toStringList());
}
void FCM_Dialog::addWhitelist()
{
const QString origin = QInputDialog::getText(this, tr("Add to whitelist"), tr("Origin:"));
addWhitelist(origin);
}
void FCM_Dialog::addWhitelist(const QString &origin)
{
if (origin.isEmpty()) {
return;
}
if (!ui->blackList->findItems(origin, Qt::MatchFixedString).isEmpty()) {
QMessageBox::information(this, tr("Already whitelisted!"), tr("The server \"%1\" is already in blacklist, please remove it first.").arg(origin));
return;
}
if (ui->whiteList->findItems(origin, Qt::MatchFixedString).isEmpty()) {
ui->whiteList->addItem(origin);
}
}
void FCM_Dialog::removeWhitelist()
{
delete ui->whiteList->currentItem();
}
void FCM_Dialog::addBlacklist()
{
const QString origin = QInputDialog::getText(this, tr("Add to blacklist"), tr("Origin:"));
addBlacklist(origin);
}
void FCM_Dialog::addBlacklist(const QString &origin)
{
if (origin.isEmpty()) {
return;
}
if (!ui->whiteList->findItems(origin, Qt::MatchFixedString).isEmpty()) {
QMessageBox::information(this, tr("Already whitelisted!"), tr("The origin \"%1\" is already in whitelist, please remove it first.").arg(origin));
return;
}
if (ui->blackList->findItems(origin, Qt::MatchFixedString).isEmpty()) {
ui->blackList->addItem(origin);
}
}
void FCM_Dialog::removeBlacklist()
{
delete ui->blackList->currentItem();
}
void FCM_Dialog::deletePressed()
{
if (ui->flashCookieTree->hasFocus()) {
removeCookie();
}
else if (ui->whiteList->hasFocus()) {
removeWhitelist();
}
else if (ui->blackList->hasFocus()) {
removeBlacklist();
}
}
void FCM_Dialog::autoModeChanged(bool state)
{
ui->notification->setEnabled(state);
}
void FCM_Dialog::filterString(const QString &string)
{
if (string.isEmpty()) {
for (int i = 0; i < ui->flashCookieTree->topLevelItemCount(); ++i) {
ui->flashCookieTree->topLevelItem(i)->setHidden(false);
ui->flashCookieTree->topLevelItem(i)->setExpanded(ui->flashCookieTree->defaultItemShowMode() == TreeWidget::ItemsExpanded);
}
}
else {
for (int i = 0; i < ui->flashCookieTree->topLevelItemCount(); ++i) {
QString text = QL1C('.') + ui->flashCookieTree->topLevelItem(i)->text(0);
ui->flashCookieTree->topLevelItem(i)->setHidden(!text.contains(string, Qt::CaseInsensitive));
ui->flashCookieTree->topLevelItem(i)->setExpanded(true);
}
}
}
void FCM_Dialog::reloadFromDisk()
{
refreshView(true);
}
void FCM_Dialog::selectFlashDataPath()
{
QString path = QzTools::getExistingDirectory(QL1S("FCM_Plugin_FlashDataPath"), this, tr("Select Flash Data Path"), ui->flashDataPath->text());
if (!path.isEmpty()) {
ui->flashDataPath->setText(path);
}
}
void FCM_Dialog::cookieTreeContextMenuRequested(const QPoint &pos)
{
QMenu menu;
QAction* actAddBlacklist = menu.addAction(tr("Add to blacklist"));
QAction* actAddWhitelist = menu.addAction(tr("Add to whitelist"));
QTreeWidgetItem* item = ui->flashCookieTree->itemAt(pos);
if (!item) {
return;
}
ui->flashCookieTree->setCurrentItem(item);
QAction* activatedAction = menu.exec(ui->flashCookieTree->viewport()->mapToGlobal(pos));
const QString origin = item->childCount() > 0 ? item->text(0)
: item->data(0, Qt::UserRole + 10).value<FlashCookie>().origin;
if (activatedAction == actAddBlacklist) {
addBlacklist(origin);
}
else if (activatedAction == actAddWhitelist) {
addWhitelist(origin);
}
}
void FCM_Dialog::closeEvent(QCloseEvent* e)
{
m_manager->clearNewOrigins();
QStringList flashWhitelist;
QStringList flashBlacklist;
for (int i = 0; i < ui->whiteList->count(); ++i) {
flashWhitelist.append(ui->whiteList->item(i)->text());
}
for (int i = 0; i < ui->blackList->count(); ++i) {
flashBlacklist.append(ui->blackList->item(i)->text());
}
QVariantHash settingsHash;
settingsHash.insert(QL1S("autoMode"), QVariant(ui->autoMode->isChecked()));
settingsHash.insert(QL1S("deleteAllOnStartExit"), QVariant(ui->deleteAllOnStartExit->isChecked()));
settingsHash.insert(QL1S("notification"), QVariant(ui->notification->isChecked()));
settingsHash.insert(QL1S("flashCookiesWhitelist"), flashWhitelist);
settingsHash.insert(QL1S("flashCookiesBlacklist"), flashBlacklist);
QString path = ui->flashDataPath->text();
path.replace(QL1C('\\'), QL1C('/'));
settingsHash.insert(QL1S("flashDataPath"), path);
m_manager->writeSettings(settingsHash);
e->accept();
}
void FCM_Dialog::keyPressEvent(QKeyEvent* e)
{
if (e->key() == Qt::Key_Escape) {
close();
}
QWidget::keyPressEvent(e);
}
FCM_Dialog::~FCM_Dialog()
{
delete ui;
}

View File

@ -0,0 +1,81 @@
/* ============================================================
* FlashCookieManager plugin for QupZilla
* Copyright (C) 2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
* Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com>
*
* some codes and ideas are taken from cookiemanager.cpp and cookiemanager.ui
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#ifndef FCM_DIALOG_H
#define FCM_DIALOG_H
#include <QDialog>
namespace Ui
{
class FCM_Dialog;
}
class QTreeWidgetItem;
class BrowserWindow;
class FCM_Plugin;
class FCM_Dialog : public QDialog
{
Q_OBJECT
public:
explicit FCM_Dialog(FCM_Plugin* manager, QWidget* parent = 0);
~FCM_Dialog();
void refreshView(bool forceReload = false);
void showPage(int index);
private slots:
void currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* parent);
void removeCookie();
void removeAll();
void refreshFlashCookiesTree();
void refreshFilters();
void addWhitelist();
void addWhitelist(const QString &origin);
void removeWhitelist();
void addBlacklist();
void addBlacklist(const QString &origin);
void removeBlacklist();
void deletePressed();
void autoModeChanged(bool state);
void filterString(const QString &string);
void reloadFromDisk();
void selectFlashDataPath();
void cookieTreeContextMenuRequested(const QPoint &pos);
private:
void closeEvent(QCloseEvent* e);
void keyPressEvent(QKeyEvent* e);
Ui::FCM_Dialog* ui;
FCM_Plugin* m_manager;
};
#endif // FCM_DIALOG_H

View File

@ -0,0 +1,646 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FCM_Dialog</class>
<widget class="QDialog" name="FCM_Dialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>508</width>
<height>431</height>
</rect>
</property>
<property name="windowTitle">
<string>Flash Cookies</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Stored Flash Cookies</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<layout class="QGridLayout" name="gridLayout_11">
<property name="verticalSpacing">
<number>6</number>
</property>
<item row="4" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Find: </string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="search"/>
</item>
</layout>
</item>
<item row="5" column="4">
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="spacing">
<number>6</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item>
<layout class="QGridLayout" name="gridLayout_12">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="SqueezeLabelV2" name="name">
<property name="text">
<string>&lt;flash cookie not selected&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Last Modified:</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Name:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="labelSize_2">
<property name="text">
<string>Size:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Origin:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="SqueezeLabelV2" name="lastModified">
<property name="text">
<string>&lt;flash cookie not selected&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="SqueezeLabelV2" name="server">
<property name="text">
<string>&lt;flash cookie not selected&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="SqueezeLabelV2" name="size">
<property name="text">
<string>&lt;flash cookie not selected&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_23">
<property name="text">
<string>Extracted latin1 strings:</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="acceptRichText">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="1">
<layout class="QVBoxLayout" name="verticalLayout_9">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_24">
<property name="text">
<string>These flash cookies are stored on your computer:</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="TreeWidget" name="flashCookieTree">
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="columnCount">
<number>1</number>
</property>
<attribute name="headerStretchLastSection">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>Origin</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item row="4" column="4">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="reloadFromDisk">
<property name="text">
<string>Reload from disk</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="labelPath">
<property name="text">
<string>Path:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="path">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Click to open containing folder</string>
</property>
<property name="text">
<string>&lt;flash cookie not selected&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QPushButton" name="removeAll">
<property name="text">
<string>Remove all flash cookies</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeOne">
<property name="text">
<string>Remove flash cookies</string>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="close">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Flash Cookies Filtering</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash cookie whitelist&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QListWidget" name="whiteList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="whiteRemove">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="whiteAdd">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Flash cookies from these origins will not be deleted automatically. (Also detection of them will not be notified to user.)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_21">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash cookie blacklist&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Flash cookies from these origins will be deleted without any notification.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QListWidget" name="blackList">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="blackRemove">
<property name="text">
<string>Remove</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="blackAdd">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="close2">
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="settingsTab">
<attribute name="title">
<string>Settings</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetNoConstraint</enum>
</property>
<item row="3" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash Cookie Settings&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="8" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="autoMode">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelAutoMode">
<property name="text">
<string>Auto mode: The flash data directory will be checked regularly. and flash cookies in blacklist will be deleted automatically.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>autoMode</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="19" column="0">
<widget class="QDialogButtonBox" name="close3">
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
<item row="17" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="18" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Note:&lt;/span&gt; This settings are just applied to flash cookies, to manage HTTP cookies use &lt;span style=&quot; font-weight:600;&quot;&gt;Cookies Manager&lt;/span&gt;. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="notification">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelNotification">
<property name="text">
<string>Notification: User will be notified for every new flash cookie that is not in blacklist and whitelist.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="16" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="deleteAllOnStartExit">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelDeleteAll">
<property name="text">
<string>Delete all flash cookies on exit/start. (except those are in whitelist)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Flash data path*:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="flashDataPath"/>
</item>
<item>
<widget class="QPushButton" name="browseFlashDataPath">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="0">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>*: You should select directory that contains #SharedObject as a subfolder.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>TreeWidget</class>
<extends>QTreeWidget</extends>
<header>treewidget.h</header>
</customwidget>
<customwidget>
<class>SqueezeLabelV2</class>
<extends>QLabel</extends>
<header>squeezelabelv2.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -0,0 +1,49 @@
/* ============================================================
* FlashCookieManager plugin for QupZilla
* Copyright (C) 2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "fcm_notification.h"
#include "ui_fcm_notification.h"
#include "iconprovider.h"
#include "fcm_plugin.h"
FCM_Notification::FCM_Notification(FCM_Plugin* manager, int newOriginsCount)
: AnimatedWidget(AnimatedWidget::Down, 300, 0)
, ui(new Ui::FCM_Notification)
, m_manager(manager)
{
setAutoFillBackground(true);
ui->setupUi(widget());
ui->close->setIcon(IconProvider::standardIcon(QStyle::SP_DialogCloseButton));
if (newOriginsCount == 1) {
ui->textLabel->setText(tr("A new flash cookie was detected"));
}
else {
ui->textLabel->setText(tr("%1 new flash cookies were detected").arg(newOriginsCount));
}
connect(ui->buttonView, SIGNAL(clicked()), m_manager, SLOT(showFlashCookieManager()));
connect(ui->buttonView, SIGNAL(clicked()), this, SLOT(hide()));
connect(ui->close, SIGNAL(clicked()), this, SLOT(hide()));
startAnimation();
}
FCM_Notification::~FCM_Notification()
{
delete ui;
}

View File

@ -0,0 +1,44 @@
/* ============================================================
* FlashCookieManager plugin for QupZilla
* Copyright (C) 2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#ifndef FCM_Notification_H
#define FCM_Notification_H
#include "animatedwidget.h"
namespace Ui
{
class FCM_Notification;
}
class FCM_Plugin;
class FCM_Notification : public AnimatedWidget
{
Q_OBJECT
public:
FCM_Notification(FCM_Plugin* manager, int newOriginsCount);
~FCM_Notification();
private:
Ui::FCM_Notification* ui;
FCM_Plugin* m_manager;
};
#endif // FCM_Notification_H

View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FCM_Notification</class>
<widget class="QWidget" name="FCM_Notification">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>820</width>
<height>36</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="pixmap">
<pixmap resource="flashcookiemanager.qrc">:/flashcookiemanager/data/flash-cookie-manager.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="textLabel">
<property name="text">
<string>New flash cookie was detected!</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonView">
<property name="text">
<string>View</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="MacToolButton" name="close">
<property name="text">
<string/>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>MacToolButton</class>
<extends>QToolButton</extends>
<header>mactoolbutton.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="flashcookiemanager.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -0,0 +1,492 @@
/* ============================================================
* FlashCookieManager plugin for QupZilla
* Copyright (C) 2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "fcm_plugin.h"
#include "browserwindow.h"
#include "pluginproxy.h"
#include "mainapplication.h"
#include "fcm_dialog.h"
#include "clickablelabel.h"
#include "tabbedwebview.h"
#include "fcm_notification.h"
#include <QStatusBar>
#include <QTimer>
#include <QSettings>
#include <QTranslator>
#include <QDir>
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
#include <QProcessEnvironment>
#endif
const int refreshInterval = 60 * 1000;
FCM_Plugin::FCM_Plugin()
: QObject()
{
}
PluginSpec FCM_Plugin::pluginSpec()
{
PluginSpec spec;
spec.name = "Flash Cookie Manager";
spec.info = "A plugin to manage flash cookies.";
spec.description = "You can easily view/delete flash cookies stored on your computer. This is a solution for having more privacy.";
spec.version = "0.3.0";
spec.author = "Razi Alavizadeh <s.r.alavizadeh@gmail.com>";
spec.icon = QPixmap(":/flashcookiemanager/data/flash-cookie-manager.png");
spec.hasSettings = true;
return spec;
}
void FCM_Plugin::init(InitState state, const QString &settingsPath)
{
m_settingsPath = settingsPath;
connect(mApp->plugins(), SIGNAL(mainWindowCreated(BrowserWindow*)), this, SLOT(mainWindowCreated(BrowserWindow*)));
connect(mApp->plugins(), SIGNAL(mainWindowDeleted(BrowserWindow*)), this, SLOT(mainWindowDeleted(BrowserWindow*)));
m_timer = new QTimer(this);
m_timer->setInterval(refreshInterval);
connect(m_timer, SIGNAL(timeout()), this, SLOT(autoRefresh()));
// start timer if needed
startStopTimer();
if (state == StartupInitState && readSettings().value(QL1S("deleteAllOnStartExit")).toBool()) {
loadFlashCookies();
removeAllButWhitelisted();
}
if (state == LateInitState) {
foreach (BrowserWindow* window, mApp->windows()) {
mainWindowCreated(window);
}
}
}
void FCM_Plugin::unload()
{
if (m_fcmDialog) {
m_fcmDialog->close();
}
if (mApp->isClosing() && readSettings().value(QL1S("deleteAllOnStartExit")).toBool()) {
removeAllButWhitelisted();
}
foreach (BrowserWindow* window, mApp->windows()) {
window->statusBar()->removeWidget(m_statusBarIcons.value(window));
delete m_statusBarIcons.value(window);
m_statusBarIcons.remove(window);
}
delete m_fcmDialog;
}
bool FCM_Plugin::testPlugin()
{
return (Qz::VERSION == QLatin1String(QUPZILLA_VERSION));
}
QTranslator* FCM_Plugin::getTranslator(const QString &locale)
{
QTranslator* translator = new QTranslator(this);
translator->load(locale, ":/flashcookiemanager/locale/");
return translator;
}
void FCM_Plugin::showSettings(QWidget* parent)
{
Q_UNUSED(parent)
showFlashCookieManager();
m_fcmDialog->showPage(2);
}
void FCM_Plugin::setFlashCookies(const QList<FlashCookie> &flashCookies)
{
m_flashCookies = flashCookies;
}
QList<FlashCookie> FCM_Plugin::flashCookies()
{
if (m_flashCookies.isEmpty()) {
loadFlashCookies();
}
return m_flashCookies;
}
QStringList FCM_Plugin::newCookiesList()
{
return m_newCookiesList;
}
void FCM_Plugin::clearNewOrigins()
{
m_newCookiesList.clear();
}
void FCM_Plugin::clearCache()
{
m_flashCookies.clear();
}
QString FCM_Plugin::flashDataPathForOS() const
{
/* On Microsoft Windows NT 5.x and 6.x, they are stored in:
* %APPDATA%\Macromedia\Flash Player\#SharedObjects\
* %APPDATA%\Macromedia\Flash Player\macromedia.com\support\flashplayer\sys\
* On Mac OS X, they are stored in:
* ~/Library/Preferences/Macromedia/Flash Player/#SharedObjects/
* ~/Library/Preferences/Macromedia/Flash Player/macromedia.com/support/flashplayer/sys/
* On Linux or Unix, they are stored in:
* ~/.macromedia/Flash_Player/#SharedObjects/
* ~/.macromedia/Flash_Player/macromedia.com/support/flashplayer/sys/
* For Linux and Unix systems, if the open-source Gnash plugin is being used
* instead of the official Adobe Flash, they will instead be found at:
* ~/.gnash/SharedObjects/
*/
if (m_flashDataPathForOS.isEmpty()) {
#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
QString appData = QProcessEnvironment::systemEnvironment().value(QL1S("APPDATA"));
appData.replace(QL1C('\\'), QL1C('/'));
m_flashDataPathForOS = (appData + QL1S("/Macromedia/Flash Player"));
#elif defined(Q_OS_MAC)
m_flashDataPathForOS = QDir::homePath() + QL1S("/Library/Preferences/Macromedia/Flash Player");
#else
if (QDir::home().cd(QL1S(".macromedia"))) {
m_flashDataPathForOS = QDir::homePath() + QL1S("/.macromedia/Flash_Player");
}
else {
m_flashDataPathForOS = QDir::homePath() + QL1S("/.gnash");
}
#endif
}
return m_flashDataPathForOS;
}
bool FCM_Plugin::isBlacklisted(const FlashCookie &flashCookie)
{
return readSettings().value(QL1S("flashCookiesBlacklist")).toStringList().contains(flashCookie.origin);
}
bool FCM_Plugin::isWhitelisted(const FlashCookie &flashCookie)
{
return readSettings().value(QL1S("flashCookiesWhitelist")).toStringList().contains(flashCookie.origin);
}
void FCM_Plugin::removeAllButWhitelisted()
{
foreach (const FlashCookie &flashCookie, m_flashCookies) {
if (isWhitelisted(flashCookie)) {
continue;
}
removeCookie(flashCookie);
}
}
QString FCM_Plugin::sharedObjectDirName() const
{
if (flashPlayerDataPath().contains(QL1S("macromedia"), Qt::CaseInsensitive) ||
!flashPlayerDataPath().contains(QL1S("/.gnash"), Qt::CaseInsensitive)) {
return QLatin1String(QL1S("/#SharedObjects/"));
}
else {
return QLatin1String(QL1S("/SharedObjects/"));
}
}
QString FCM_Plugin::flashPlayerDataPath() const
{
return readSettings().value(QL1S("flashDataPath")).toString();
}
QVariantHash FCM_Plugin::readSettings() const
{
if (m_settingsHash.isEmpty()) {
m_settingsHash.insert(QL1S("autoMode"), QVariant(false));
m_settingsHash.insert(QL1S("deleteAllOnStartExit"), QVariant(false));
m_settingsHash.insert(QL1S("notification"), QVariant(false));
m_settingsHash.insert(QL1S("flashCookiesWhitelist"), QVariant());
m_settingsHash.insert(QL1S("flashCookiesBlacklist"), QVariant());
m_settingsHash.insert(QL1S("flashDataPath"), flashDataPathForOS());
QSettings settings(m_settingsPath + QL1S("/extensions.ini"), QSettings::IniFormat);
settings.beginGroup(QL1S("FlashCookieManager"));
QVariantHash::iterator i = m_settingsHash.begin();
while (i != m_settingsHash.end()) {
*i = settings.value(i.key(), i.value());
++i;
}
settings.endGroup();
}
return m_settingsHash;
}
void FCM_Plugin::writeSettings(const QVariantHash &hashSettings)
{
m_settingsHash = hashSettings;
QSettings settings(m_settingsPath + QL1S(QL1S("/extensions.ini")), QSettings::IniFormat);
settings.beginGroup(QL1S("FlashCookieManager"));
QVariantHash::const_iterator i = m_settingsHash.constBegin();
while (i != m_settingsHash.constEnd()) {
settings.setValue(i.key(), i.value());
++i;
}
settings.endGroup();
startStopTimer();
}
void FCM_Plugin::removeCookie(const FlashCookie &flashCookie)
{
if (m_flashCookies.contains(flashCookie)) {
m_flashCookies.removeOne(flashCookie);
if (QFile(flashCookie.path + QL1C('/') + flashCookie.name).remove()) {
QDir dir(flashCookie.path);
dir.rmpath(flashCookie.path);
}
}
}
void FCM_Plugin::autoRefresh()
{
if (m_fcmDialog && m_fcmDialog->isVisible()) {
return;
}
QList<FlashCookie> oldflashCookies = m_flashCookies;
loadFlashCookies();
QStringList newCookieList;
foreach (const FlashCookie &flashCookie, m_flashCookies) {
if (isBlacklisted(flashCookie)) {
removeCookie(flashCookie);
continue;
}
if (isWhitelisted(flashCookie)) {
continue;
}
bool newCookie = true;
foreach (const FlashCookie &oldFlashCookie, oldflashCookies) {
if (QString(oldFlashCookie.path + oldFlashCookie.name) ==
QString(flashCookie.path + flashCookie.name)) {
newCookie = false;
break;
}
}
if (newCookie) {
newCookieList << flashCookie.path + QL1C('/') + flashCookie.name;
}
}
if (!newCookieList.isEmpty() && readSettings().value(QL1S("notification")).toBool()) {
m_newCookiesList << newCookieList;
BrowserWindow* window = mApp->getWindow();
if (!window) {
return;
}
TabbedWebView* weView = window->weView();
if (!weView) {
return;
}
FCM_Notification* notif = new FCM_Notification(this, newCookieList.size());
weView->addNotification(notif);
}
}
void FCM_Plugin::showFlashCookieManager()
{
if (!m_fcmDialog) {
m_fcmDialog = new FCM_Dialog(this);
}
m_fcmDialog->refreshView();
m_fcmDialog->showPage(0);
m_fcmDialog->show();
m_fcmDialog->raise();
}
void FCM_Plugin::mainWindowCreated(BrowserWindow *window)
{
window->statusBar()->addPermanentWidget(createStatusBarIcon(window));
}
void FCM_Plugin::mainWindowDeleted(BrowserWindow *window)
{
if (!window) {
return;
}
if (m_fcmDialog && m_fcmDialog->parent() == window) {
m_fcmDialog->setParent(0);
}
window->statusBar()->removeWidget(m_statusBarIcons.value(window));
delete m_statusBarIcons.value(window);
m_statusBarIcons.remove(window);
}
void FCM_Plugin::startStopTimer()
{
if (readSettings().value(QL1S("autoMode")).toBool()) {
if (!m_timer->isActive()) {
if (m_flashCookies.isEmpty()) {
loadFlashCookies();
}
m_timer->start();
}
}
else {
m_timer->stop();
}
}
QWidget* FCM_Plugin::createStatusBarIcon(BrowserWindow* mainWindow)
{
if (m_statusBarIcons.contains(mainWindow)) {
return m_statusBarIcons.value(mainWindow);
}
ClickableLabel* icon = new ClickableLabel(mainWindow);
icon->setCursor(Qt::PointingHandCursor);
QPixmap p(":/flashcookiemanager/data/flash-cookie-manager.png");
icon->setPixmap(p.scaledToHeight(16));
icon->setToolTip(tr("Show/Hide Flash Cookie Manager"));
connect(icon, SIGNAL(clicked(QPoint)), this, SLOT(showFlashCookieManager()));
m_statusBarIcons.insert(mainWindow, icon);
return icon;
}
void FCM_Plugin::loadFlashCookies()
{
m_flashCookies.clear();
loadFlashCookies(flashPlayerDataPath());
}
void FCM_Plugin::loadFlashCookies(QString path)
{
QDir solDir(path);
QStringList entryList = solDir.entryList();
entryList.removeAll(QL1S("."));
entryList.removeAll(QL1S(".."));
foreach(QString entry, entryList) {
if (path.endsWith(QL1S("#SharedObjects")) && entry == QL1S("#AppContainer")) {
// specific to IE and Windows
continue;
}
path.replace(QL1C('\\'), QL1C('/'));
QFileInfo entryInfo(path + QL1C('/') + entry);
if (entryInfo.isDir()) {
loadFlashCookies(entryInfo.filePath());
}
else if (entryInfo.isFile() && entryInfo.suffix() == QL1S("sol")) {
insertFlashCookie(entryInfo.filePath());
}
}
}
void FCM_Plugin::insertFlashCookie(QString path)
{
QFile solFile(path);
if (!solFile.open(QFile::ReadOnly)) {
return;
}
QByteArray file = solFile.readAll();
for (int i = 0; i < file.size(); ++i) {
if (!((file.at(i) >= 'a' && file.at(i) <= 'z') || (file.at(i) >= 'A' && file.at(i) <= 'Z') ||
(file.at(i) >= '0' && file.at(i) <= '9'))) {
file[i] = ' ';
}
}
QString fileStr = QString(file);
fileStr = fileStr.split(QL1C('.'), QString::SkipEmptyParts).join(QL1S("\n"));
QFileInfo solFileInfo(solFile);
FlashCookie flashCookie;
flashCookie.contents = fileStr;
flashCookie.name = solFileInfo.fileName();
flashCookie.path = solFileInfo.canonicalPath();
flashCookie.size = (int)solFile.size();
flashCookie.lastModification = solFileInfo.lastModified();
flashCookie.origin = extractOriginFrom(path);
m_flashCookies << flashCookie;
}
QString FCM_Plugin::extractOriginFrom(const QString &path)
{
QString origin = path;
if (path.startsWith(flashPlayerDataPath() + sharedObjectDirName())) {
origin.remove(flashPlayerDataPath() + sharedObjectDirName());
if (origin.indexOf(QL1C('/')) != -1) {
origin.remove(0, origin.indexOf(QL1C('/')) + 1);
}
}
else if (path.startsWith(flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys/"))) {
origin.remove(flashPlayerDataPath() + QL1S("/macromedia.com/support/flashplayer/sys/"));
if (origin == QL1S("settings.sol")) {
return tr("!default");
}
else if (origin.startsWith(QL1C('#'))) {
origin.remove(0, 1);
}
}
else {
origin.clear();
}
int index = origin.indexOf(QL1C('/'));
if (index == -1) {
return tr("!other");
}
origin = origin.remove(index, origin.size());
if (origin == QL1S("localhost") || origin == QL1S("local")) {
origin = QL1S("!localhost");
}
return origin;
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2(FlashCookieManagerPlugin, FCM_Plugin)
#endif

View File

@ -0,0 +1,113 @@
/* ============================================================
* FlashCookieManager plugin for QupZilla
* Copyright (C) 2014 S. Razi Alavizadeh <s.r.alavizadeh@gmail.com>
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#ifndef FLASHCOOKIEMANAGER_H
#define FLASHCOOKIEMANAGER_H
#include "plugininterface.h"
#include <QPointer>
#include <QDateTime>
class BrowserWindow;
class FCM_Dialog;
class QTimer;
struct FlashCookie {
QString name;
QString origin;
int size;
QString path;
QString contents;
QDateTime lastModification;
bool operator ==(const FlashCookie &other) {
return (this->name == other.name && this->path == other.path);
}
};
class FCM_Plugin : public QObject, public PluginInterface
{
Q_OBJECT
Q_INTERFACES(PluginInterface)
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.FlashCookieManager")
#endif
public:
explicit FCM_Plugin();
PluginSpec pluginSpec();
void init(InitState state, const QString &settingsPath);
void unload();
bool testPlugin();
QTranslator* getTranslator(const QString &locale);
void showSettings(QWidget* parent = 0);
void setFlashCookies(const QList<FlashCookie> &flashCookies);
QList<FlashCookie> flashCookies();
QStringList newCookiesList();
void clearNewOrigins();
void clearCache();
QString flashPlayerDataPath() const;
QVariantHash readSettings() const;
void writeSettings(const QVariantHash &hashSettings);
void removeCookie(const FlashCookie &flashCookie);
private slots:
void autoRefresh();
void showFlashCookieManager();
void mainWindowCreated(BrowserWindow* window);
void mainWindowDeleted(BrowserWindow* window);
void startStopTimer();
private:
QWidget* createStatusBarIcon(BrowserWindow* mainWindow);
void loadFlashCookies();
void loadFlashCookies(QString path);
void insertFlashCookie(QString path);
QString extractOriginFrom(const QString &path);
QString flashDataPathForOS() const;
bool isBlacklisted(const FlashCookie &flashCookie);
bool isWhitelisted(const FlashCookie &flashCookie);
void removeAllButWhitelisted();
QString sharedObjectDirName() const;
QHash<BrowserWindow*, QWidget*> m_statusBarIcons;
QPointer<FCM_Dialog> m_fcmDialog;
QString m_settingsPath;
QList<FlashCookie> m_flashCookies;
QTimer* m_timer;
mutable QVariantHash m_settingsHash;
bool m_autoMode;
bool m_deleteOnClose;
bool m_enableNotification;
QStringList m_blaklist;
QStringList m_whitelist;
QStringList m_newCookiesList;
mutable QString m_flashDataPathForOS;
};
Q_DECLARE_METATYPE(FlashCookie);
#endif // FLASHCOOKIEMANAGER_H

View File

@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/flashcookiemanager">
<file>data/flash-cookie-manager.png</file>
<file>locale/fa_IR.qm</file>
</qresource>
</RCC>

View File

@ -0,0 +1,272 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">
<context>
<name>FCM_Dialog</name>
<message>
<location filename="../fcm_dialog.ui" line="14"/>
<source>Flash Cookies</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="24"/>
<source>Stored Flash Cookies</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="45"/>
<source>Find: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="73"/>
<location filename="../fcm_dialog.ui" line="120"/>
<location filename="../fcm_dialog.ui" line="130"/>
<location filename="../fcm_dialog.ui" line="140"/>
<location filename="../fcm_dialog.ui" line="256"/>
<location filename="../fcm_dialog.cpp" line="149"/>
<location filename="../fcm_dialog.cpp" line="150"/>
<location filename="../fcm_dialog.cpp" line="151"/>
<location filename="../fcm_dialog.cpp" line="152"/>
<source>&lt;flash cookie not selected&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="83"/>
<source>Last Modified:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="96"/>
<source>Name:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="106"/>
<source>Size:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="113"/>
<location filename="../fcm_dialog.cpp" line="275"/>
<location filename="../fcm_dialog.cpp" line="290"/>
<source>Origin:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="152"/>
<source>Extracted latin1 strings:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="182"/>
<source>These flash cookies are stored on your computer:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="202"/>
<source>Origin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="227"/>
<source>Reload from disk</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="240"/>
<source>Path:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="253"/>
<source>Click to open containing folder</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="276"/>
<source>Remove all flash cookies</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="283"/>
<location filename="../fcm_dialog.cpp" line="154"/>
<source>Remove flash cookies</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="308"/>
<source>Flash Cookies Filtering</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="316"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash cookie whitelist&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="348"/>
<location filename="../fcm_dialog.ui" line="416"/>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="355"/>
<location filename="../fcm_dialog.ui" line="423"/>
<source>Add</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="364"/>
<source>Flash cookies from these origins will not be deleted automatically. (Also detection of them will not be notified to user.)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="374"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash cookie blacklist&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="381"/>
<source>Flash cookies from these origins will be deleted without any notification.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="442"/>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="453"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash Cookie Settings&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="475"/>
<source>Auto mode: The flash data directory will be checked regularly. and flash cookies in blacklist will be deleted automatically.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="510"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Note:&lt;/span&gt; This settings are just applied to flash cookies, to manage HTTP cookies use &lt;span style=&quot; font-weight:600;&quot;&gt;Cookies Manager&lt;/span&gt;. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="538"/>
<source>Notification: User will be notified for every new flash cookie that is not in blacklist and whitelist.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="565"/>
<source>Delete all flash cookies on exit/start. (except those are in whitelist)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="579"/>
<source>Flash data path*:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="595"/>
<source>Browse...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="617"/>
<source>*: You should select directory that contains #SharedObject as a subfolder.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="77"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="91"/>
<source>Confirmation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="92"/>
<source>Are you sure to delete all flash cookies on your computer?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="164"/>
<location filename="../fcm_dialog.cpp" line="235"/>
<source> (settings)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="167"/>
<source> Byte</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="173"/>
<source>Remove flash cookie</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="239"/>
<source> [new]</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="275"/>
<source>Add to whitelist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="290"/>
<source>Add to blacklist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="345"/>
<source>Select Flash Data Path</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FCM_Notification</name>
<message>
<location filename="../fcm_notification.ui" line="45"/>
<source>New flash cookie was detected!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_notification.ui" line="52"/>
<source>View</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_notification.cpp" line="34"/>
<source>A new flash cookie was detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_notification.cpp" line="37"/>
<source>%1 new flash cookies were detected</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>FCM_Plugin</name>
<message>
<location filename="../fcm_plugin.cpp" line="353"/>
<source>Show/Hide Flash Cookie Manager</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_plugin.cpp" line="439"/>
<source>!default</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../fcm_plugin.cpp" line="451"/>
<source>!other</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,272 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fa_IR">
<context>
<name>FCM_Dialog</name>
<message>
<location filename="../fcm_dialog.ui" line="14"/>
<source>Flash Cookies</source>
<translation>فلش کوکیهای</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="24"/>
<source>Stored Flash Cookies</source>
<translation>فلشکوکیهای ذخیره شده</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="45"/>
<source>Find: </source>
<translation>یافتن:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="73"/>
<location filename="../fcm_dialog.ui" line="120"/>
<location filename="../fcm_dialog.ui" line="130"/>
<location filename="../fcm_dialog.ui" line="140"/>
<location filename="../fcm_dialog.ui" line="256"/>
<location filename="../fcm_dialog.cpp" line="149"/>
<location filename="../fcm_dialog.cpp" line="150"/>
<location filename="../fcm_dialog.cpp" line="151"/>
<location filename="../fcm_dialog.cpp" line="152"/>
<source>&lt;flash cookie not selected&gt;</source>
<translation>&lt;فلشکوکی انتخاب نشده است&gt;</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="96"/>
<source>Name:</source>
<translation>نام:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="113"/>
<location filename="../fcm_dialog.cpp" line="275"/>
<location filename="../fcm_dialog.cpp" line="290"/>
<source>Origin:</source>
<translation>منشا:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="202"/>
<source>Origin</source>
<translation>منشا</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="227"/>
<source>Reload from disk</source>
<translation>بارگذاری مجدد از دیسک</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="240"/>
<source>Path:</source>
<translation>مسیر:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="253"/>
<source>Click to open containing folder</source>
<translation>برای باز کردن پوشه کلیک کنید</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="182"/>
<source>These flash cookies are stored on your computer:</source>
<translation>فلشکوکیها ذخیره شده بروی رایانهتان:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="83"/>
<source>Last Modified:</source>
<translation>آخرین ویرایش:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="106"/>
<source>Size:</source>
<translation>اندازه:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="152"/>
<source>Extracted latin1 strings:</source>
<translation>رشتههای لاتین-۱ استخراج شده:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="276"/>
<source>Remove all flash cookies</source>
<translation>حذف همه فلشکوکیها</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="283"/>
<location filename="../fcm_dialog.cpp" line="154"/>
<source>Remove flash cookies</source>
<translation>حذف فلشکوکیها</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="308"/>
<source>Flash Cookies Filtering</source>
<translation>پالایش فلشکوکیها</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="316"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash cookie whitelist&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;span style=&quot; font-weight:600;&quot;&gt;سپیدنامه فلشکوکی&lt;/span&gt;</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="381"/>
<source>Flash cookies from these origins will be deleted without any notification.</source>
<translation>فلشکوکیهای این مبداها بدون هیچ اعلانی حذف خواهند شد.</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="510"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Note:&lt;/span&gt; This settings are just applied to flash cookies, to manage HTTP cookies use &lt;span style=&quot; font-weight:600;&quot;&gt;Cookies Manager&lt;/span&gt;. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;توجه:&lt;/span&gt; این تنظیمات فقط به فلشکوکیها اعمال میشوند، برای مدیریت کوکیهای HTTP &lt;span style=&quot; font-weight:600;&quot;&gt;مدیریت کوکیها&lt;/span&gt; را بکار ببرید.&lt;/p&gt;</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="348"/>
<location filename="../fcm_dialog.ui" line="416"/>
<source>Remove</source>
<translation>حذف</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="355"/>
<location filename="../fcm_dialog.ui" line="423"/>
<source>Add</source>
<translation>اضافه</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="364"/>
<source>Flash cookies from these origins will not be deleted automatically. (Also detection of them will not be notified to user.)</source>
<translation>فلشکوکیهای این مبداها بطور خودکار حذف نخواهند شد. (همچنین ایجاد شدن آنها به کاربر اطلاع داده نخواهد شد.)</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="374"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash cookie blacklist&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;سیاهنامه فلشکوکیها&lt;/span&gt;&lt;/p&gt;</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="442"/>
<source>Settings</source>
<translation>سامانش</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="453"/>
<source>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Flash Cookie Settings&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;سامانش فلشکوکی&lt;/span&gt;&lt;/p&gt;</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="475"/>
<source>Auto mode: The flash data directory will be checked regularly. and flash cookies in blacklist will be deleted automatically.</source>
<translation>حالت خودکار: پوشه دادههای فلش بطور منظم بررسی خواهد شد و فلشکوکیهای مربوط به سیاهنامه بطور خودکار حذف خواهند شد.</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="538"/>
<source>Notification: User will be notified for every new flash cookie that is not in blacklist and whitelist.</source>
<translation>اعلان: هر فلشکوکی جدید که در سیاهنامه و سپیدنامه نیست به کاربر اعلان خواهد شد.</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="565"/>
<source>Delete all flash cookies on exit/start. (except those are in whitelist)</source>
<translation>حذف همه فلشکوکیها در آغاز به کار/خروج. (بجز أنها که در سپیدنامه قرار دارند.)</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="579"/>
<source>Flash data path*:</source>
<translation>مسیر دادههای فلش*:</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="595"/>
<source>Browse...</source>
<translation>گزیدن...</translation>
</message>
<message>
<location filename="../fcm_dialog.ui" line="617"/>
<source>*: You should select directory that contains #SharedObject as a subfolder.</source>
<translation>*: باید پوشهای که #SharedObject را به عنوان زیرپوشه در بردارد انتخاب کنید. </translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="77"/>
<source>Search</source>
<translation>یافتن</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="91"/>
<source>Confirmation</source>
<translation>تایید</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="92"/>
<source>Are you sure to delete all flash cookies on your computer?</source>
<translation>آیا از حذف همه فلشکوکیهای از روی رایانهتان مطمئنید؟</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="164"/>
<location filename="../fcm_dialog.cpp" line="235"/>
<source> (settings)</source>
<translation> (سامانش)</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="167"/>
<source> Byte</source>
<translation> بایت</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="173"/>
<source>Remove flash cookie</source>
<translation>حذف فلشکوکی</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="239"/>
<source> [new]</source>
<translation> [جدید]</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="275"/>
<source>Add to whitelist</source>
<translation>اضافهکردن به سپیدنامه</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="290"/>
<source>Add to blacklist</source>
<translation>اضافهکردن به سیاهنامه</translation>
</message>
<message>
<location filename="../fcm_dialog.cpp" line="345"/>
<source>Select Flash Data Path</source>
<translation>انتخاب مسیر دادههای فلش</translation>
</message>
</context>
<context>
<name>FCM_Notification</name>
<message>
<location filename="../fcm_notification.cpp" line="34"/>
<source>A new flash cookie was detected</source>
<translation>فلشکوکی تازهای پیدا شد</translation>
</message>
<message>
<location filename="../fcm_notification.cpp" line="37"/>
<source>%1 new flash cookies were detected</source>
<translation>%1 فلشکوکی تازه پیدا شدند</translation>
</message>
<message>
<location filename="../fcm_notification.ui" line="45"/>
<source>New flash cookie was detected!</source>
<translation>فلشکوکی تازهای پیدا شد!</translation>
</message>
<message>
<location filename="../fcm_notification.ui" line="52"/>
<source>View</source>
<translation>نمایش</translation>
</message>
</context>
<context>
<name>FCM_Plugin</name>
<message>
<location filename="../fcm_plugin.cpp" line="352"/>
<source>Show/Hide Flash Cookie Manager</source>
<translation>نمایش دادن/پنهان ساختن مدیر فلشکوکی</translation>
</message>
<message>
<location filename="../fcm_plugin.cpp" line="438"/>
<source>!default</source>
<translation>!پیشفرض</translation>
</message>
<message>
<location filename="../fcm_plugin.cpp" line="450"/>
<source>!other</source>
<translation>!دیگر</translation>
</message>
</context>
</TS>