diff --git a/src/plugins/FlashCookieManager/FlashCookieManager.pro b/src/plugins/FlashCookieManager/FlashCookieManager.pro new file mode 100644 index 000000000..8bbb2a792 --- /dev/null +++ b/src/plugins/FlashCookieManager/FlashCookieManager.pro @@ -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 diff --git a/src/plugins/FlashCookieManager/README.md b/src/plugins/FlashCookieManager/README.md new file mode 100644 index 000000000..4187d6bf0 --- /dev/null +++ b/src/plugins/FlashCookieManager/README.md @@ -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/) + \ No newline at end of file diff --git a/src/plugins/FlashCookieManager/data/flash-cookie-manager.png b/src/plugins/FlashCookieManager/data/flash-cookie-manager.png new file mode 100644 index 000000000..57940ad51 Binary files /dev/null and b/src/plugins/FlashCookieManager/data/flash-cookie-manager.png differ diff --git a/src/plugins/FlashCookieManager/fcm_dialog.cpp b/src/plugins/FlashCookieManager/fcm_dialog.cpp new file mode 100644 index 000000000..07fa4077d --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_dialog.cpp @@ -0,0 +1,452 @@ +/* ============================================================ +* FlashCookieManager plugin for QupZilla +* Copyright (C) 2014 S. Razi Alavizadeh +* Copyright (C) 2010-2014 David Rosca +* +* 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 . +* ============================================================ */ +#include "fcm_dialog.h" +#include "ui_fcm_dialog.h" +#include "qztools.h" +#include "iconprovider.h" +#include "fcm_plugin.h" + +#include +#include +#include +#include +#include +#include + +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 &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 &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(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("")); + ui->size->setText(tr("")); + ui->server->setText(tr("")); + ui->lastModified->setText(tr("")); + + ui->removeOne->setText(tr("Remove flash cookies")); + ui->path->hide(); + ui->labelPath->hide(); + return; + } + + const FlashCookie flashCookie = qvariant_cast(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("%2").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 &flashCookies = m_manager->flashCookies(); + + QApplication::setOverrideCursor(Qt::WaitCursor); + ui->flashCookieTree->clear(); + + int counter = 0; + QPointer guard = this; + QHash 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().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; +} diff --git a/src/plugins/FlashCookieManager/fcm_dialog.h b/src/plugins/FlashCookieManager/fcm_dialog.h new file mode 100644 index 000000000..3f553bad4 --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_dialog.h @@ -0,0 +1,81 @@ +/* ============================================================ +* FlashCookieManager plugin for QupZilla +* Copyright (C) 2014 S. Razi Alavizadeh +* Copyright (C) 2010-2014 David Rosca +* +* 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 . +* ============================================================ */ +#ifndef FCM_DIALOG_H +#define FCM_DIALOG_H + +#include + + +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 diff --git a/src/plugins/FlashCookieManager/fcm_dialog.ui b/src/plugins/FlashCookieManager/fcm_dialog.ui new file mode 100644 index 000000000..6ea2e3704 --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_dialog.ui @@ -0,0 +1,646 @@ + + + FCM_Dialog + + + + 0 + 0 + 508 + 431 + + + + Flash Cookies + + + + + + 0 + + + + Stored Flash Cookies + + + + + + QLayout::SetNoConstraint + + + + + 6 + + + + + 6 + + + + + Find: + + + + + + + + + + + + 6 + + + QLayout::SetNoConstraint + + + + + QLayout::SetNoConstraint + + + 6 + + + + + <flash cookie not selected> + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + Last Modified: + + + + + + + + 0 + 0 + + + + Name: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Size: + + + + + + + Origin: + + + + + + + <flash cookie not selected> + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + <flash cookie not selected> + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + <flash cookie not selected> + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + Extracted latin1 strings: + + + + + + + + 0 + 0 + + + + true + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + 0 + + + + + These flash cookies are stored on your computer: + + + true + + + + + + + true + + + 1 + + + true + + + + Origin + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Reload from disk + + + + + + + + + + + + + Path: + + + + + + + + 0 + 0 + + + + Click to open containing folder + + + <flash cookie not selected> + + + true + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + + + + Remove all flash cookies + + + + + + + Remove flash cookies + + + + + + + + 0 + 0 + + + + QDialogButtonBox::Close + + + + + + + + + + + + Flash Cookies Filtering + + + + + + + + <html><head/><body><p><span style=" font-weight:600;">Flash cookie whitelist</span></p></body></html> + + + + + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Remove + + + + + + + Add + + + + + + + + + Flash cookies from these origins will not be deleted automatically. (Also detection of them will not be notified to user.) + + + true + + + + + + + <html><head/><body><p><span style=" font-weight:600;">Flash cookie blacklist</span></p></body></html> + + + + + + + Flash cookies from these origins will be deleted without any notification. + + + true + + + + + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Remove + + + + + + + Add + + + + + + + + + + + QDialogButtonBox::Close + + + + + + + + Settings + + + + + + QLayout::SetNoConstraint + + + + + <html><head/><body><p><span style=" font-weight:600;">Flash Cookie Settings</span></p></body></html> + + + + + + + + + + 0 + 0 + + + + + + + + + + + Auto mode: The flash data directory will be checked regularly. and flash cookies in blacklist will be deleted automatically. + + + true + + + autoMode + + + + + + + + + QDialogButtonBox::Close + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + <html><head/><body><p><span style=" font-weight:600;">Note:</span> This settings are just applied to flash cookies, to manage HTTP cookies use <span style=" font-weight:600;">Cookies Manager</span>. </p></body></html> + + + true + + + true + + + + + + + + + + 0 + 0 + + + + + + + + + + + Notification: User will be notified for every new flash cookie that is not in blacklist and whitelist. + + + true + + + + + + + + + + + + 0 + 0 + + + + + + + + + + + Delete all flash cookies on exit/start. (except those are in whitelist) + + + true + + + + + + + + + + + Flash data path*: + + + + + + + + + + + 0 + 0 + + + + Browse... + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + *: You should select directory that contains #SharedObject as a subfolder. + + + true + + + + + + + + + + + + + + TreeWidget + QTreeWidget +
treewidget.h
+
+ + SqueezeLabelV2 + QLabel +
squeezelabelv2.h
+
+
+ + +
diff --git a/src/plugins/FlashCookieManager/fcm_notification.cpp b/src/plugins/FlashCookieManager/fcm_notification.cpp new file mode 100644 index 000000000..228072a8e --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_notification.cpp @@ -0,0 +1,49 @@ +/* ============================================================ +* FlashCookieManager plugin for QupZilla +* Copyright (C) 2014 S. Razi Alavizadeh +* +* 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 . +* ============================================================ */ +#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; +} diff --git a/src/plugins/FlashCookieManager/fcm_notification.h b/src/plugins/FlashCookieManager/fcm_notification.h new file mode 100644 index 000000000..8711d2406 --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_notification.h @@ -0,0 +1,44 @@ +/* ============================================================ +* FlashCookieManager plugin for QupZilla +* Copyright (C) 2014 S. Razi Alavizadeh +* +* 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 . +* ============================================================ */ +#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 diff --git a/src/plugins/FlashCookieManager/fcm_notification.ui b/src/plugins/FlashCookieManager/fcm_notification.ui new file mode 100644 index 000000000..5fe4ffe09 --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_notification.ui @@ -0,0 +1,92 @@ + + + FCM_Notification + + + + 0 + 0 + 820 + 36 + + + + + 0 + + + 0 + + + + + + 24 + 24 + + + + + 24 + 24 + + + + :/flashcookiemanager/data/flash-cookie-manager.png + + + true + + + + + + + New flash cookie was detected! + + + + + + + View + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + true + + + + + + + + MacToolButton + QToolButton +
mactoolbutton.h
+
+
+ + + + +
diff --git a/src/plugins/FlashCookieManager/fcm_plugin.cpp b/src/plugins/FlashCookieManager/fcm_plugin.cpp new file mode 100644 index 000000000..9f28d3123 --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_plugin.cpp @@ -0,0 +1,492 @@ +/* ============================================================ +* FlashCookieManager plugin for QupZilla +* Copyright (C) 2014 S. Razi Alavizadeh +* +* 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 . +* ============================================================ */ +#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 +#include +#include +#include +#include + +#if defined(Q_OS_WIN) || defined(Q_OS_OS2) +#include +#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 "; + 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 &flashCookies) +{ + m_flashCookies = flashCookies; +} + +QList 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 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 diff --git a/src/plugins/FlashCookieManager/fcm_plugin.h b/src/plugins/FlashCookieManager/fcm_plugin.h new file mode 100644 index 000000000..efaae89a9 --- /dev/null +++ b/src/plugins/FlashCookieManager/fcm_plugin.h @@ -0,0 +1,113 @@ +/* ============================================================ +* FlashCookieManager plugin for QupZilla +* Copyright (C) 2014 S. Razi Alavizadeh +* +* 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 . +* ============================================================ */ +#ifndef FLASHCOOKIEMANAGER_H +#define FLASHCOOKIEMANAGER_H + +#include "plugininterface.h" + +#include +#include + +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 &flashCookies); + QList 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 m_statusBarIcons; + QPointer m_fcmDialog; + + QString m_settingsPath; + QList 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 diff --git a/src/plugins/FlashCookieManager/flashcookiemanager.qrc b/src/plugins/FlashCookieManager/flashcookiemanager.qrc new file mode 100644 index 000000000..3821522e2 --- /dev/null +++ b/src/plugins/FlashCookieManager/flashcookiemanager.qrc @@ -0,0 +1,6 @@ + + + data/flash-cookie-manager.png + locale/fa_IR.qm + + diff --git a/src/plugins/FlashCookieManager/translations/empty.ts b/src/plugins/FlashCookieManager/translations/empty.ts new file mode 100644 index 000000000..511eeff62 --- /dev/null +++ b/src/plugins/FlashCookieManager/translations/empty.ts @@ -0,0 +1,272 @@ + + + + + FCM_Dialog + + + Flash Cookies + + + + + Stored Flash Cookies + + + + + Find: + + + + + + + + + + + + + <flash cookie not selected> + + + + + Last Modified: + + + + + Name: + + + + + Size: + + + + + + + Origin: + + + + + Extracted latin1 strings: + + + + + These flash cookies are stored on your computer: + + + + + Origin + + + + + Reload from disk + + + + + Path: + + + + + Click to open containing folder + + + + + Remove all flash cookies + + + + + + Remove flash cookies + + + + + Flash Cookies Filtering + + + + + <html><head/><body><p><span style=" font-weight:600;">Flash cookie whitelist</span></p></body></html> + + + + + + Remove + + + + + + Add + + + + + Flash cookies from these origins will not be deleted automatically. (Also detection of them will not be notified to user.) + + + + + <html><head/><body><p><span style=" font-weight:600;">Flash cookie blacklist</span></p></body></html> + + + + + Flash cookies from these origins will be deleted without any notification. + + + + + Settings + + + + + <html><head/><body><p><span style=" font-weight:600;">Flash Cookie Settings</span></p></body></html> + + + + + Auto mode: The flash data directory will be checked regularly. and flash cookies in blacklist will be deleted automatically. + + + + + <html><head/><body><p><span style=" font-weight:600;">Note:</span> This settings are just applied to flash cookies, to manage HTTP cookies use <span style=" font-weight:600;">Cookies Manager</span>. </p></body></html> + + + + + Notification: User will be notified for every new flash cookie that is not in blacklist and whitelist. + + + + + Delete all flash cookies on exit/start. (except those are in whitelist) + + + + + Flash data path*: + + + + + Browse... + + + + + *: You should select directory that contains #SharedObject as a subfolder. + + + + + Search + + + + + Confirmation + + + + + Are you sure to delete all flash cookies on your computer? + + + + + + (settings) + + + + + Byte + + + + + Remove flash cookie + + + + + [new] + + + + + Add to whitelist + + + + + Add to blacklist + + + + + Select Flash Data Path + + + + + FCM_Notification + + + New flash cookie was detected! + + + + + View + + + + + A new flash cookie was detected + + + + + %1 new flash cookies were detected + + + + + FCM_Plugin + + + Show/Hide Flash Cookie Manager + + + + + !default + + + + + !other + + + + diff --git a/src/plugins/FlashCookieManager/translations/fa_IR.ts b/src/plugins/FlashCookieManager/translations/fa_IR.ts new file mode 100644 index 000000000..537f78682 --- /dev/null +++ b/src/plugins/FlashCookieManager/translations/fa_IR.ts @@ -0,0 +1,272 @@ + + + + + FCM_Dialog + + + Flash Cookies + فلش کوکی‌های + + + + Stored Flash Cookies + فلش‌کوکی‌های ذخیره شده + + + + Find: + یافتن: + + + + + + + + + + + + <flash cookie not selected> + <فلش‌کوکی انتخاب نشده است> + + + + Name: + نام: + + + + + + Origin: + منشا: + + + + Origin + منشا + + + + Reload from disk + بارگذاری مجدد از دیسک + + + + Path: + مسیر: + + + + Click to open containing folder + برای باز کردن پوشه کلیک کنید + + + + These flash cookies are stored on your computer: + فلش‌کوکی‌ها ذخیره شده بروی رایانه‌تان: + + + + Last Modified: + آخرین ویرایش: + + + + Size: + اندازه: + + + + Extracted latin1 strings: + رشته‌های لاتین-۱ استخراج شده: + + + + Remove all flash cookies + حذف همه فلش‌کوکی‌ها + + + + + Remove flash cookies + حذف فلش‌کوکی‌ها + + + + Flash Cookies Filtering + پالایش فلش‌کوکی‌ها + + + + <html><head/><body><p><span style=" font-weight:600;">Flash cookie whitelist</span></p></body></html> + <span style=" font-weight:600;">سپیدنامه فلش‌کوکی</span> + + + + Flash cookies from these origins will be deleted without any notification. + فلش‌کوکی‌های این مبداها بدون هیچ اعلانی حذف خواهند شد. + + + + <html><head/><body><p><span style=" font-weight:600;">Note:</span> This settings are just applied to flash cookies, to manage HTTP cookies use <span style=" font-weight:600;">Cookies Manager</span>. </p></body></html> + <p><span style=" font-weight:600;">توجه:</span> این تنظیمات فقط به فلش‌کوکی‌ها اعمال می‌شوند، برای مدیریت کوکی‌های HTTP <span style=" font-weight:600;">مدیریت کوکی‌ها</span> را بکار ببرید.</p> + + + + + Remove + حذف + + + + + Add + اضافه + + + + Flash cookies from these origins will not be deleted automatically. (Also detection of them will not be notified to user.) + فلش‌کوکی‌های این مبداها بطور خودکار حذف نخواهند شد. (همچنین ایجاد شدن آنها به کاربر اطلاع داده نخواهد شد.) + + + + <html><head/><body><p><span style=" font-weight:600;">Flash cookie blacklist</span></p></body></html> + <p><span style=" font-weight:600;">سیاه‌نامه فلش‌کوکی‌ها</span></p> + + + + Settings + سامانش + + + + <html><head/><body><p><span style=" font-weight:600;">Flash Cookie Settings</span></p></body></html> + <p><span style=" font-weight:600;">سامانش فلش‌کوکی</span></p> + + + + Auto mode: The flash data directory will be checked regularly. and flash cookies in blacklist will be deleted automatically. + حالت خودکار: پوشه داده‌های فلش بطور منظم بررسی خواهد شد و فلش‌کوکی‌های مربوط به سیاه‌نامه بطور خودکار حذف خواهند شد. + + + + Notification: User will be notified for every new flash cookie that is not in blacklist and whitelist. + اعلان: هر فلش‌کوکی جدید که در سیاه‌نامه و سپیدنامه نیست به کاربر اعلان خواهد شد. + + + + Delete all flash cookies on exit/start. (except those are in whitelist) + حذف همه فلش‌کوکی‌ها در آغاز به کار/خروج. (بجز أنها که در سپیدنامه قرار دارند.) + + + + Flash data path*: + مسیر داده‌های فلش*: + + + + Browse... + گزیدن... + + + + *: You should select directory that contains #SharedObject as a subfolder. + *: باید پوشه‌ای که ‎#SharedObject را به عنوان زیرپوشه در بردارد انتخاب کنید. + + + + Search + یافتن + + + + Confirmation + تایید + + + + Are you sure to delete all flash cookies on your computer? + آیا از حذف همه فلش‌کوکی‌های از روی رایانه‌تان مطمئنید؟ + + + + + (settings) + (سامانش) + + + + Byte + بایت + + + + Remove flash cookie + حذف فلش‌کوکی + + + + [new] + [جدید] + + + + Add to whitelist + اضافه‌کردن به سپیدنامه + + + + Add to blacklist + اضافه‌کردن به سیاه‌نامه + + + + Select Flash Data Path + انتخاب مسیر داده‌های فلش + + + + FCM_Notification + + + A new flash cookie was detected + فلش‌کوکی تازه‌ای پیدا شد + + + + %1 new flash cookies were detected + %1 فلش‌کوکی تازه پیدا شدند + + + + New flash cookie was detected! + فلش‌کوکی تازه‌ای پیدا شد! + + + + View + نمایش + + + + FCM_Plugin + + + Show/Hide Flash Cookie Manager + نمایش دادن/پنهان ساختن مدیر فلش‌کوکی + + + + !default + !پیش‌فرض + + + + !other + !دیگر + + +