# Use KDE Frameworks to handle internationalization of the following UI files.
ki18n_wrap_ui(privacy-browser
- ui/AddOrEditCookieDialog.ui
- ui/BrowserView.ui
- ui/CookiesDialog.ui
- ui/DomainSettingsDialog.ui
- ui/SettingsGeneral.ui
- ui/SettingsPrivacy.ui
+ uis/AddOrEditCookieDialog.ui
+ uis/BrowserView.ui
+ uis/CookiesDialog.ui
+ uis/DomainSettingsDialog.ui
+ uis/SettingsGeneral.ui
+ uis/SettingsPrivacy.ui
)
# Link the following libraries.
add_subdirectory(filters)
add_subdirectory(helpers)
add_subdirectory(interceptors)
-add_subdirectory(ui.rc)
+add_subdirectory(structs)
+add_subdirectory(ui.rcs)
add_subdirectory(views)
add_subdirectory(windows)
const int AddOrEditCookieDialog::AddCookie = 0;
const int AddOrEditCookieDialog::EditCookie = 1;
+// Construct the class.
AddOrEditCookieDialog::AddOrEditCookieDialog(const int &dialogType, const QNetworkCookie *cookiePointer) : QDialog(nullptr)
{
// Set the dialog window title according to the dialog type.
#include <QShortcut>
#include <QUrl>
+// Construct the class.
bool cookieSortPredicate(const QNetworkCookie &leftHandCookie, const QNetworkCookie &rightHandCookie)
{
// Check to see if the domains are identical.
}
}
-CookiesDialog::CookiesDialog(std::forward_list<QNetworkCookie> *originalCookieListPointer) : QDialog(nullptr), cookieListPointer(originalCookieListPointer)
+CookiesDialog::CookiesDialog(std::list<QNetworkCookie> *originalCookieListPointer) : QDialog(nullptr), cookieListPointer(originalCookieListPointer)
{
// Set the dialog window title.
setWindowTitle(i18nc("The cookies dialog window title", "Cookies"));
#include <QTreeView>
// C++ headers.
-#include <forward_list>
+#include <list>
class CookiesDialog : public QDialog
{
public:
// The primary constructor.
- explicit CookiesDialog(std::forward_list<QNetworkCookie> *cookieListPointer);
+ explicit CookiesDialog(std::list<QNetworkCookie> *cookieListPointer);
signals:
// The signals.
// The private variables.
QItemSelectionModel *treeViewSelectionModelPointer;
QPushButton *addCookieButtonPointer;
- std::forward_list<QNetworkCookie> *cookieListPointer;
+ std::list<QNetworkCookie> *cookieListPointer;
QPushButton *deleteAllButtonPointer;
QPushButton *deleteCookieButtonPointer;
QPushButton *editCookieButtonPointer;
const int DomainSettingsDialog::ADD_DOMAIN = 1;
const int DomainSettingsDialog::EDIT_DOMAIN = 2;
+// Construct the class.
DomainSettingsDialog::DomainSettingsDialog(const int &startType, const QString &domainName) : QDialog(nullptr)
{
// Set the window title.
// Setup the UI.
domainSettingsDialogUi.setupUi(this);
- // Get handles for the views.
+ // Get handles for the widgets.
domainsListViewPointer = domainSettingsDialogUi.domainsListView;
domainSettingsWidgetPointer = domainSettingsDialogUi.domainSettingsWidget;
domainNameLineEditPointer = domainSettingsDialogUi.domainNameLineEdit;
javaScriptComboBoxPointer = domainSettingsDialogUi.javaScriptComboBox;
javaScriptLabelPointer = domainSettingsDialogUi.javaScriptLabel;
- localStorageComboBoxPointer = domainSettingsDialogUi.localStorageComboBox;
- localStorageLabelPointer = domainSettingsDialogUi.localStorageLabel;
+ domStorageComboBoxPointer = domainSettingsDialogUi.domStorageComboBox;
+ domStorageLabelPointer = domainSettingsDialogUi.domStorageLabel;
userAgentComboBoxPointer = domainSettingsDialogUi.userAgentComboBox;
userAgentLabelPointer = domainSettingsDialogUi.userAgentLabel;
zoomFactorComboBoxPointer = domainSettingsDialogUi.zoomFactorComboBox;
// Handle clicks on the domains.
connect(domainsListViewPointer, SIGNAL(activated(QModelIndex)), this, SLOT(domainSelected(QModelIndex)));
- // Connect the domain settings.
+ // Process changes to the domain settings.
connect(domainNameLineEditPointer, SIGNAL(textEdited(QString)), this, SLOT(domainNameChanged(QString)));
connect(javaScriptComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(javaScriptChanged(int)));
- connect(localStorageComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(localStorageChanged(int)));
+ connect(domStorageComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(domStorageChanged(int)));
connect(userAgentComboBoxPointer, SIGNAL(currentTextChanged(QString)), this, SLOT(userAgentChanged(QString)));
connect(zoomFactorComboBoxPointer, SIGNAL(currentIndexChanged(int)), this, SLOT(zoomFactorComboBoxChanged(int)));
connect(customZoomFactorSpinBoxPointer, SIGNAL(valueChanged(double)), this, SLOT(customZoomFactorChanged(double)));
// Set the values for the new domain.
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOMAIN_NAME), domainName);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::JAVASCRIPT), DomainsDatabaseHelper::SYSTEM_DEFAULT);
- newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::LOCAL_STORAGE), DomainsDatabaseHelper::SYSTEM_DEFAULT);
+ newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOM_STORAGE), DomainsDatabaseHelper::SYSTEM_DEFAULT);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::USER_AGENT), UserAgentHelper::SYSTEM_DEFAULT_DATABASE);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::ZOOM_FACTOR), DomainsDatabaseHelper::SYSTEM_DEFAULT);
newDomainRecord.setValue(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::CUSTOM_ZOOM_FACTOR), 1.0);
// Populate the JavaScript combo box.
javaScriptComboBoxPointer->setCurrentIndex(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::JAVASCRIPT)).data().toInt());
- // Populate the local storage combo box.
- localStorageComboBoxPointer->setCurrentIndex(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::LOCAL_STORAGE)).data().toInt());
+ // Populate the DOM storage combo box.
+ domStorageComboBoxPointer->setCurrentIndex(modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOM_STORAGE)).data().toInt());
// Get the user agent string.
QString userAgent = modelIndex.siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::USER_AGENT)).data().toString();
// Populate the labels.
populateJavaScriptLabel();
- populateLocalStorageLabel();
+ populateDomStorageLabel();
populateUserAgentLabel(userAgentComboBoxPointer->currentText());
// Update the UI.
updateUi();
}
-void DomainSettingsDialog::localStorageChanged(const int &newIndex) const
+void DomainSettingsDialog::domStorageChanged(const int &newIndex) const
{
// Update the domains table model.
- domainsTableModelPointer->setData(domainsListViewPointer->selectionModel()->currentIndex().siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::LOCAL_STORAGE)),
+ domainsTableModelPointer->setData(domainsListViewPointer->selectionModel()->currentIndex().siblingAtColumn(domainsTableModelPointer->fieldIndex(DomainsDatabaseHelper::DOM_STORAGE)),
newIndex);
- // Populate the local storage label.
- populateLocalStorageLabel();
+ // Populate the DOM storage label.
+ populateDomStorageLabel();
// Update the UI.
updateUi();
case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
{
// Set the text according to the system default.
- if (Settings::javaScript()) javaScriptLabelPointer->setText(i18nc("Domains settings label", "JavaScript enabled"));
- else javaScriptLabelPointer->setText(i18nc("Domain settings label", "JavaScript disabled"));
+ if (Settings::javaScriptEnabled())
+ javaScriptLabelPointer->setText(i18nc("Domains settings label", "JavaScript enabled"));
+ else
+ javaScriptLabelPointer->setText(i18nc("Domain settings label", "JavaScript disabled"));
break;
}
case (DomainsDatabaseHelper::DISABLED):
{
// Set the label text in bold.
- javaScriptLabelPointer->setText(i18nc("Domain settings label. The <strong> tags should be retained.", "<strong>JavaScript disabled</strong>"));
+ javaScriptLabelPointer->setText(i18nc("Domain settings label. The <b> tags should be retained.", "<b>JavaScript disabled</b>"));
break;
}
case (DomainsDatabaseHelper::ENABLED):
{
// Set the label text in bold.
- javaScriptLabelPointer->setText(i18nc("Domains settings label. The <strong> tags should be retained.", "<strong>JavaScript enabled</strong>"));
+ javaScriptLabelPointer->setText(i18nc("Domains settings label. The <b> tags should be retained.", "<b>JavaScript enabled</b>"));
break;
}
}
}
-void DomainSettingsDialog::populateLocalStorageLabel() const
+void DomainSettingsDialog::populateDomStorageLabel() const
{
// Populate the label according to the currently selected index.
- switch (localStorageComboBoxPointer->currentIndex())
+ switch (domStorageComboBoxPointer->currentIndex())
{
case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
{
// Set the text according to the system default.
- if (Settings::localStorage()) localStorageLabelPointer->setText(i18nc("Local storage label", "Local storage enabled"));
- else localStorageLabelPointer->setText(i18nc("Local storage label", "Local storage disabled"));
+ if (Settings::domStorageEnabled())
+ domStorageLabelPointer->setText(i18nc("DOM storage label", "DOM storage enabled"));
+ else
+ domStorageLabelPointer->setText(i18nc("DOM storage label", "DOM storage disabled"));
break;
}
case (DomainsDatabaseHelper::DISABLED):
{
// Set the label text in bold.
- localStorageLabelPointer->setText(i18nc("Local storage label. The <string> tags should be retained.", "<strong>Local storage disabled</strong>"));
+ domStorageLabelPointer->setText(i18nc("DOM storage label. The <b> tags should be retained.", "<b>DOM storage disabled</b>"));
break;
}
case (DomainsDatabaseHelper::ENABLED):
{
// Set the label text in bold.
- localStorageLabelPointer->setText(i18nc("Local storage label. The <strong> tags should be retained.", "<strong>Local storage enabled</strong>"));
+ domStorageLabelPointer->setText(i18nc("DOM storage label. The <b> tags should be retained.", "<b>DOM storage enabled</b>"));
break;
}
void apply() const;
void cancel();
void customZoomFactorChanged(const double &newValue) const;
+ void domStorageChanged(const int &newIndex) const;
void domainNameChanged(const QString &updatedDomainName) const;
void domainSelected(const QModelIndex &modelIndex) const;
void javaScriptChanged(const int &newIndex) const;
- void localStorageChanged(const int &newIndex) const;
void ok();
void reset() const;
void showAddMessageBox();
QPushButton *applyButtonPointer;
QDoubleSpinBox *customZoomFactorSpinBoxPointer;
QPushButton *deleteDomainButtonPointer;
+ QComboBox *domStorageComboBoxPointer;
+ QLabel *domStorageLabelPointer;
QListView *domainsListViewPointer;
KLineEdit *domainNameLineEditPointer;
QWidget *domainSettingsWidgetPointer;
QSqlTableModel *domainsTableModelPointer;
QComboBox *javaScriptComboBoxPointer;
QLabel *javaScriptLabelPointer;
- QComboBox *localStorageComboBoxPointer;
- QLabel *localStorageLabelPointer;
QPushButton *resetButtonPointer;
QComboBox *userAgentComboBoxPointer;
QLabel *userAgentLabelPointer;
// The private functions.
void addDomain(const QString &domainName) const;
void populateJavaScriptLabel() const;
- void populateLocalStorageLabel() const;
+ void populateDomStorageLabel() const;
void populateUserAgentLabel(const QString &userAgentName) const;
void updateUi() const;
};
// The primary constructor.
MouseEventFilter::MouseEventFilter() : QObject() {};
+// Construct the class.
bool MouseEventFilter::eventFilter(QObject *objectPointer, QEvent *eventPointer)
{
// Only process mouse button press events.
const QString DomainsDatabaseHelper::_ID = "_id";
const QString DomainsDatabaseHelper::DOMAIN_NAME = "domain_name";
const QString DomainsDatabaseHelper::JAVASCRIPT = "javascript";
-const QString DomainsDatabaseHelper::LOCAL_STORAGE = "local_storage";
+const QString DomainsDatabaseHelper::DOM_STORAGE = "dom_storage";
const QString DomainsDatabaseHelper::USER_AGENT = "user_agent";
const QString DomainsDatabaseHelper::ZOOM_FACTOR = "zoom_factor";
const QString DomainsDatabaseHelper::CUSTOM_ZOOM_FACTOR = "custom_zoom_factor";
-// The default constructor.
+// Construct the class.
DomainsDatabaseHelper::DomainsDatabaseHelper() {}
void DomainsDatabaseHelper::addDatabase()
// Upgrade from schema version 3 to schema version 4.
case 3:
- // Add the Local Storage column.
- domainsDatabase.exec("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + LOCAL_STORAGE + " INTEGER DEFAULT 0");
+ // Add the DOM Storage column.
+ domainsDatabase.exec("ALTER TABLE " + DOMAINS_TABLE + " ADD COLUMN " + DOM_STORAGE + " INTEGER DEFAULT 0");
}
// Update the schema version.
_ID + " INTEGER PRIMARY KEY, " +
DOMAIN_NAME + " TEXT, " +
JAVASCRIPT + " INTEGER DEFAULT 0, " +
- LOCAL_STORAGE + " INTEGER DEFAULT 0, " +
+ DOM_STORAGE + " INTEGER DEFAULT 0, " +
USER_AGENT + " TEXT DEFAULT '" + UserAgentHelper::SYSTEM_DEFAULT_DATABASE + "', " +
ZOOM_FACTOR + " INTEGER DEFAULT 0, " +
CUSTOM_ZOOM_FACTOR + " REAL DEFAULT 1.0)"
static const QString _ID;
static const QString CONNECTION_NAME;
static const QString CUSTOM_ZOOM_FACTOR;
+ static const QString DOM_STORAGE;
static const QString DOMAIN_NAME;
static const QString DOMAINS_TABLE;
static const QString JAVASCRIPT;
- static const QString LOCAL_STORAGE;
static const QString USER_AGENT;
static const QString ZOOM_FACTOR;
// Application headers.
#include "SearchEngineHelper.h"
-// The default constructor.
+// Construct the class.
SearchEngineHelper::SearchEngineHelper() {};
QString SearchEngineHelper::getSearchUrl(const QString &searchEngineName)
const QString UserAgentHelper::EDGE_WINDOWS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.56");
const QString UserAgentHelper::SAFARI_MACOS_USER_AGENT = QStringLiteral("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15");
-// The default constructor.
+// Construct the class.
UserAgentHelper::UserAgentHelper() {};
QString UserAgentHelper::getDatabaseUserAgentNameFromTranslatedName(const QString &translatedUserAgentName)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ viewBox="0 0 256 256"
+ version="1.1"
+ id="svg8"
+ sodipodi:docname="cookies-off.svg"
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
+ width="256"
+ height="256"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview10"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ showgrid="false"
+ inkscape:zoom="6.3203125"
+ inkscape:cx="65.89864"
+ inkscape:cy="135.19901"
+ inkscape:window-width="3644"
+ inkscape:window-height="2015"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg8"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0" />
+ <defs
+ id="defs3051">
+ <style
+ type="text/css"
+ id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#232629;
+ }
+ .ColorScheme-PositiveText {
+ color:#27ae60;
+ }
+ </style>
+ </defs>
+ <path
+ style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:15.9983"
+ d="M 128,8.0125 A 95.990005,95.990005 0 0 0 56.757416,40.00916 H 16.011659 c -8.863077,0 -15.998334,7.13526 -15.998334,15.99834 v 95.99 c 0,8.86307 7.135257,15.99833 15.998334,15.99833 h 40.589524 a 95.990005,95.990005 0 0 0 71.336327,31.99667 c -8.83345,0.0342 -15.93584,7.15657 -15.93584,15.99833 0,0.44796 0.20198,0.8332 0.24997,1.28115 -25.9493,3.69558 -48.307471,14.71719 -48.307471,14.71719 V 247.9875 H 191.93084 v -15.99833 c 0,0 -22.29418,-11.02161 -48.30747,-14.71722 0.032,-0.44795 0.24997,-0.83319 0.24997,-1.28115 0,-8.82044 -7.06953,-15.93016 -15.87334,-15.9983 a 95.990005,95.990005 0 0 0 71.24257,-31.99667 h 40.74576 c 8.86308,0 15.99834,-7.13526 15.99834,-15.99833 v -95.99 c 0,-8.86308 -7.13526,-15.99834 -15.99834,-15.99834 H 199.39882 A 95.990005,95.990005 0 0 0 128,8.0125 Z m 0,15.99833 a 79.991671,79.991671 0 0 1 49.46359,17.34194 79.991671,79.991671 0 0 1 3.18718,2.62473 79.991671,79.991671 0 0 1 2.93719,2.74971 79.991671,79.991671 0 0 1 2.93719,2.99969 79.991671,79.991671 0 0 1 2.84346,3.21842 79.991671,79.991671 0 0 1 2.49974,3.06218 h 48.11998 V 72.00583 H 223.99 v 63.99333 h 15.99833 v 15.99835 H 191.86835 A 79.991671,79.991671 0 0 1 175.83877,167.99583 79.991671,79.991671 0 0 1 128,183.99418 79.991671,79.991671 0 0 1 78.536398,166.65223 a 79.991671,79.991671 0 0 1 -3.187167,-2.62474 79.991671,79.991671 0 0 1 -2.937195,-2.74971 79.991671,79.991671 0 0 1 -2.937193,-2.99969 79.991671,79.991671 0 0 1 -2.843455,-3.21842 79.991671,79.991671 0 0 1 -2.499739,-3.06217 H 16.011659 V 135.99916 H 32.009993 V 72.00583 H 16.011659 V 56.0075 H 64.162895 A 79.991671,79.991671 0 0 1 69.256115,49.85189 79.991671,79.991671 0 0 1 80.161229,40.00916 79.991671,79.991671 0 0 1 128,24.01083 Z"
+ class="ColorScheme-Text"
+ id="path4" />
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ viewBox="0 0 256 256"
+ version="1.1"
+ id="svg8"
+ sodipodi:docname="cookies-on.svg"
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
+ width="256"
+ height="256"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview10"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ showgrid="false"
+ inkscape:zoom="3.1601563"
+ inkscape:cx="-133.37948"
+ inkscape:cy="4.9048207"
+ inkscape:window-width="3644"
+ inkscape:window-height="2015"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg8" />
+ <defs
+ id="defs3051">
+ <style
+ type="text/css"
+ id="current-color-scheme">
+ .ColorScheme-Text {
+ color:#232629;
+ }
+ .ColorScheme-PositiveText {
+ color:#27ae60;
+ }
+ </style>
+ </defs>
+ <g
+ id="g825"
+ transform="translate(0,7.036695)">
+ <path
+ style="fill:currentColor;fill-opacity:1;stroke:none;stroke-width:15.9951"
+ d="M 127.96086,1 A 95.970643,95.970643 0 0 0 56.732645,32.990214 H 15.995107 C 7.1338178,32.990214 0,40.124032 0,48.985321 v 95.970639 c 0,8.86129 7.1338178,15.99511 15.995107,15.99511 h 40.581337 a 95.970643,95.970643 0 0 0 71.321936,31.99022 c -8.83168,0.0342 -15.93263,7.15512 -15.93263,15.9951 0,0.44787 0.20194,0.83303 0.24992,1.28089 -25.94406,3.69484 -48.297722,14.71422 -48.297722,14.71422 v 15.99511 H 191.87881 V 224.9315 c 0,0 -22.2897,-11.01938 -48.29773,-14.71425 0.032,-0.44786 0.24992,-0.83303 0.24992,-1.28089 0,-8.81866 -7.0681,-15.92695 -15.87014,-15.99507 a 95.970643,95.970643 0 0 0 71.22821,-31.99022 h 40.73754 c 8.86129,0 15.9951,-7.13382 15.9951,-15.99511 V 48.985321 c 0,-8.861289 -7.13381,-15.995107 -15.9951,-15.995107 H 199.34528 A 95.970643,95.970643 0 0 0 127.96086,1 Z m 0,15.995107 a 79.975535,79.975535 0 0 1 49.45362,17.338447 79.975535,79.975535 0 0 1 3.18653,2.624197 79.975535,79.975535 0 0 1 2.93659,2.749159 79.975535,79.975535 0 0 1 2.93661,2.999083 79.975535,79.975535 0 0 1 2.84289,3.217766 79.975535,79.975535 0 0 1 2.49923,3.061562 h 48.11028 V 64.980428 H 223.9315 v 63.980432 h 15.99511 v 15.9951 h -48.11028 a 79.975535,79.975535 0 0 1 -16.02636,15.99511 79.975535,79.975535 0 0 1 -47.82911,15.99511 79.975535,79.975535 0 0 1 -49.453626,-17.33844 79.975535,79.975535 0 0 1 -3.186524,-2.62421 79.975535,79.975535 0 0 1 -2.936603,-2.74916 79.975535,79.975535 0 0 1 -2.936601,-2.99908 79.975535,79.975535 0 0 1 -2.84288,-3.21777 79.975535,79.975535 0 0 1 -2.499236,-3.06156 H 15.995107 v -15.9951 H 31.990214 V 64.980428 H 15.995107 V 48.985321 H 64.13663 a 79.975535,79.975535 0 0 1 5.092193,-6.154367 79.975535,79.975535 0 0 1 10.902914,-9.84074 79.975535,79.975535 0 0 1 47.829123,-15.995107 z"
+ class="ColorScheme-Text"
+ id="path4" />
+ <path
+ style="fill:#f67400;fill-opacity:1;stroke:none;stroke-width:15.9951"
+ class="ColorScheme-PositiveText"
+ d="M 175.94618,96.970406 A 47.985321,47.985321 0 0 1 127.96086,144.95573 47.985321,47.985321 0 0 1 79.975535,96.970406 47.985321,47.985321 0 0 1 127.96086,48.985085 47.985321,47.985321 0 0 1 175.94618,96.970406 Z"
+ id="path6" />
+ </g>
+</svg>
// Application headers.
#include "UrlRequestInterceptor.h"
-// The default constructor.
+// Construct the class.
UrlRequestInterceptor::UrlRequestInterceptor(QObject *parentObjectPointer) : QWebEngineUrlRequestInterceptor(parentObjectPointer) {}
void UrlRequestInterceptor::interceptRequest(QWebEngineUrlRequestInfo &urlRequestInfo)
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource>
+ <file>icons/cookies-off.svg</file>
+ <file>icons/cookies-on.svg</file>
<file>icons/javascript-warning.svg</file>
<file>icons/privacy-mode.svg</file>
<file>icons/sc-apps-privacy-browser.svg</file>
<kcfgfile name="privacybrowser"/>
<group name="Privacy">
- <entry name="javaScript" type="Bool">
+ <entry name="javaScriptEnabled" type="Bool">
<default>false</default>
</entry>
- <entry name="localStorage" type="Bool">
+ <entry name="cookiesEnabled" type="Bool">
+ <default>false</default>
+ </entry>
+
+ <entry name="domStorageEnabled" type="Bool">
<default>false</default>
</entry>
# Specify the class name, which will be used to autogenerate .cpp and .h files.
ClassName=Settings
-# Make the generated class a singleton. TODO, the default is false. This may not be needed.
+# Make the generated class a singleton.
Singleton=true
--- /dev/null
+# Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+#
+# This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+#
+# Privacy Browser PC 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.
+#
+# Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+
+
+# List the sources to include in the executable.
+target_sources(privacy-browser PRIVATE
+ PrivacyWebEngine.cpp
+)
--- /dev/null
+/*
+ * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ *
+ * Privacy Browser PC 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.
+ *
+ * Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Application headers.
+#include "PrivacyWebEngine.h"
+
+// Construct the struct.
+PrivacyWebEngine::PrivacyWebEngine(QWebEngineView *inputWebEngineViewPointer) : webEngineViewPointer(inputWebEngineViewPointer)
+{
+ // Initialize the cookie status.
+ cookiesEnabled = false;
+}
--- /dev/null
+/*
+ * Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+ *
+ * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ *
+ * Privacy Browser PC 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.
+ *
+ * Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PRIVACYWEBENGINE_H
+#define PRIVACYWEBENGINE_H
+
+// Qt toolkit headers.
+#include <QWebEngineView>
+
+struct PrivacyWebEngine
+{
+public:
+ // The primary constructor.
+ PrivacyWebEngine(QWebEngineView *inputWebEngineViewPointer);
+
+ // The public variables.
+ bool cookiesEnabled;
+ QWebEngineView *webEngineViewPointer;
+};
+#endif
+++ /dev/null
-# Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-#
-# This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
-#
-# Privacy Browser PC 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.
-#
-# Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
-
-
-# Install Privacy Browser's RC (Runtime Configuration) files.
-install(FILES
- browser_ui.rc
- DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/privacybrowser)
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
- Privacy Browser PC 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.
-
- Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
-
-<!-- Documentation at <https://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology>. -->
-<!-- Better documentation at <https://invent.kde.org/frameworks/kxmlgui/-/blob/master/src/kxmlgui.xsd>. -->
-<gui
- name="privacybrowser"
- version="1"
- xmlns="http://www.kde.org/standards/kxmlgui/1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
-
- <!-- The menu bar. -->
- <MenuBar>
- <!-- On-the-fly Settings. -->
- <Menu name="on_the_fly_settings"> <text>On-The-Fly Settings</text>
- <Menu name="user_agent" icon="user-group-properties"> <text>User Agent</text>
- <Action name="user_agent_privacy_browser" />
- <Action name="user_agent_webengine_default" />
- <Action name="user_agent_firefox_linux" />
- <Action name="user_agent_chromium_linux" />
- <Action name="user_agent_firefox_windows" />
- <Action name="user_agent_chrome_windows" />
- <Action name="user_agent_edge_windows" />
- <Action name="user_agent_safari_macos" />
- <Action name="user_agent_custom" />
- </Menu>
-
- <Action name="zoom_factor" />
-
- <Separator />
-
- <Menu name="search_engine" icon="search"> <text>Search Engine</text>
- <Action name="search_engine_mojeek" />
- <Action name="search_engine_monocles" />
- <Action name="search_engine_metager" />
- <Action name="search_engine_google" />
- <Action name="search_engine_bing" />
- <Action name="search_engine_yahoo" />
- <Action name="search_engine_custom" />
- </Menu>
- </Menu>
-
- <!-- Settings. -->
- <Menu name="settings">
- <Action name="domain_settings" />
- <Action name="cookies" />
- </Menu>
- </MenuBar>
-
- <!-- The main toolbar is removed. -->
- <ToolBar name="mainToolBar" deleted="true" />
-
- <!-- The navigation toolbar. -->
- <ToolBar name="navigation_toolbar" iconText="icononly"> <text>Navigation Toolbar</text>
- <Action name="go_back" />
- <Action name="go_forward" />
- <Action name="view_redisplay" />
- <Action name="go_home" />
- </ToolBar>
-
- <!-- The URL toolbar. -->
- <ToolBar name="url_toolbar" iconText="icononly"> <text>URL Toolbar</text>
- <Action name="javascript" />
- <Action name="local_storage" />
- </ToolBar>
-</gui>
--- /dev/null
+# Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+#
+# This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+#
+# Privacy Browser PC 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.
+#
+# Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>.
+
+
+# Install Privacy Browser's RC (Runtime Configuration) files.
+install(FILES
+ browser_ui.rc
+ DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/privacybrowser)
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+ Privacy Browser PC 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.
+
+ Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
+
+<!-- Documentation at <https://techbase.kde.org/Development/Architecture/KDE4/XMLGUI_Technology>. -->
+<!-- Better documentation at <https://invent.kde.org/frameworks/kxmlgui/-/blob/master/src/kxmlgui.xsd>. -->
+<gui
+ name="privacybrowser"
+ version="1"
+ xmlns="http://www.kde.org/standards/kxmlgui/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
+
+ <!-- The menu bar. -->
+ <MenuBar>
+ <!-- On-the-fly Settings. -->
+ <Menu name="on_the_fly_settings"> <text>On-The-Fly Settings</text>
+ <Menu name="user_agent" icon="user-group-properties"> <text>User Agent</text>
+ <Action name="user_agent_privacy_browser" />
+ <Action name="user_agent_webengine_default" />
+ <Action name="user_agent_firefox_linux" />
+ <Action name="user_agent_chromium_linux" />
+ <Action name="user_agent_firefox_windows" />
+ <Action name="user_agent_chrome_windows" />
+ <Action name="user_agent_edge_windows" />
+ <Action name="user_agent_safari_macos" />
+ <Action name="user_agent_custom" />
+ </Menu>
+
+ <Action name="zoom_factor" />
+
+ <Separator />
+
+ <Menu name="search_engine" icon="search"> <text>Search Engine</text>
+ <Action name="search_engine_mojeek" />
+ <Action name="search_engine_monocles" />
+ <Action name="search_engine_metager" />
+ <Action name="search_engine_google" />
+ <Action name="search_engine_bing" />
+ <Action name="search_engine_yahoo" />
+ <Action name="search_engine_custom" />
+ </Menu>
+ </Menu>
+
+ <!-- Settings. -->
+ <Menu name="settings">
+ <Action name="domain_settings" />
+ <Action name="cookies" />
+ </Menu>
+ </MenuBar>
+
+ <!-- The main toolbar is removed. -->
+ <ToolBar name="mainToolBar" deleted="true" />
+
+ <!-- The navigation toolbar. -->
+ <ToolBar name="navigation_toolbar" iconText="icononly"> <text>Navigation Toolbar</text>
+ <Action name="go_back" />
+ <Action name="go_forward" />
+ <Action name="view_redisplay" />
+ <Action name="go_home" />
+ </ToolBar>
+
+ <!-- The URL toolbar. -->
+ <ToolBar name="url_toolbar" iconText="icononly"> <text>URL Toolbar</text>
+ <Action name="javascript" />
+ <Action name="on-the-fly_cookies" />
+ <Action name="dom_storage" />
+ </ToolBar>
+</gui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
- Privacy Browser PC 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.
-
- Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
-
-<ui version="4.0">
- <class>AddOrEditCookieDialog</class>
-
- <widget class="QWidget">
- <layout class="QVBoxLayout">
- <item>
- <!-- First row. -->
- <layout class="QHBoxLayout">
- <property name="alignment">
- <enum>Qt::AlignLeft</enum>
- </property>
-
- <!-- Domain. -->
- <item>
- <widget class="QLabel">
- <property name="toolTip">
- <string>Cookies prepended by a period are accessible to all subdomains.</string>
- </property>
-
- <property name="text">
- <string>Domain</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLineEdit" name="domainLineEdit" />
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
-
- <!-- Spacer label. -->
- <property name="text">
- <string>&nbsp;&nbsp;&nbsp;</string>
- </property>
- </widget>
- </item>
-
- <!-- Name. -->
- <item>
- <widget class="QLabel">
- <property name="toolTip">
- <string>The name identifies the cookie. Each cookie has a unique combination of domain, name, and path.</string>
- </property>
-
- <property name="text">
- <string>Name</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLineEdit" name="nameLineEdit" />
- </item>
- </layout>
- </item>
-
- <!-- Second row. -->
- <item>
- <layout class="QHBoxLayout">
- <property name="alignment">
- <enum>Qt::AlignLeft</enum>
- </property>
-
- <!-- Path. -->
- <item>
- <widget class="QLabel">
- <property name="toolTip">
- <string>Websites can restrict cookie access to subpath of their URL.</string>
- </property>
-
- <property name="text">
- <string>Path</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLineEdit" name="pathLineEdit">
- <property name="text">
- <string>/</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
-
- <!-- Spacer label. -->
- <property name="text">
- <string>&nbsp;&nbsp;&nbsp;</string>
- </property>
- </widget>
- </item>
-
- <!-- Expiration date. -->
- <item>
- <widget class="QCheckBox" name="expirationCheckBox">
- <property name="toolTip">
- <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="toolTip">
- <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
- </property>
-
- <property name="text">
- <string>Expiration date</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
-
- <!-- Spacer label. -->
- <property name="text">
- <string>&nbsp;</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QDateTimeEdit" name="expirationDateTimeEdit">
- <property name="dateTime">
- <datetime>
- <year>2030</year>
- <month>1</month>
- <day>1</day>
- <hour>0</hour>
- <minute>0</minute>
- <second>0</second>
- </datetime>
- </property>
-
- <property name="calendarPopup">
- <bool>true</bool>
- </property>
-
- <property name="enabled">
- <bool>false</bool>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
-
- <!-- Spacer label. -->
- <property name="text">
- <string>&nbsp;&nbsp;&nbsp;</string>
- </property>
- </widget>
- </item>
-
- <!-- HTTP only. -->
- <item>
- <widget class="QCheckBox" name="httpOnlyCheckBox">
- <property name="toolTip">
- <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
- </property>
-
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="toolTip">
- <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
- </property>
-
- <property name="text">
- <string>HTTP only</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
-
- <!-- Spacer label. -->
- <property name="text">
- <string>&nbsp;&nbsp;&nbsp;</string>
- </property>
- </widget>
- </item>
-
- <!-- Secure. -->
- <item>
- <widget class="QCheckBox" name="secureCheckBox">
- <property name="toolTip">
- <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
- </property>
-
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLabel">
- <property name="toolTip">
- <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
- </property>
-
- <property name="text">
- <string>Secure</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
-
- <!-- Third row. -->
- <item>
- <layout class="QHBoxLayout">
- <property name="alignment">
- <enum>Qt::AlignLeft</enum>
- </property>
-
- <!-- Value. -->
- <item>
- <widget class="QLabel">
- <property name="toolTip">
- <string>The value contains the cookie data.</string>
- </property>
-
- <property name="text">
- <string>Value</string>
- </property>
- </widget>
- </item>
-
- <item>
- <widget class="QLineEdit" name="valueLineEdit" />
- </item>
- </layout>
- </item>
-
- <!-- Spacer. -->
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- </spacer>
- </item>
-
- <!-- Dialog buttons. -->
- <item>
- <widget class="QDialogButtonBox" name="dialogButtonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Save | QDialogButtonBox::Cancel</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
- Privacy Browser PC 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.
-
- Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
-
-<ui version="4.0">
- <class>BrowserView</class>
- <!-- Main widget. -->
- <widget class="QWidget">
- <!-- Main layout. -->
- <layout class="QVBoxLayout">
- <!-- Set the spacing between items to 0. -->
- <property name="spacing">
- <number>0</number>
- </property>
-
- <!-- Set the margins to 0. -->
- <property name="topMargin">
- <number>0</number>
- </property>
-
- <property name="bottomMargin">
- <number>0</number>
- </property>
-
- <property name="leftMargin">
- <number>0</number>
- </property>
-
- <property name="rightMargin">
- <number>0</number>
- </property>
-
- <!-- WebEngine view. -->
- <item>
- <widget class="QWebEngineView" name="webEngineView" />
- </item>
- </layout>
- </widget>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
- Privacy Browser PC 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.
-
- Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
-
-<ui version="4.0">
- <class>CookiesDialog</class>
-
-
- <widget class="QWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <height>1000</height>
- <width>1500</width>
- </rect>
- </property>
-
- <layout class="QVBoxLayout">
- <item>
- <!-- Scroll area. -->
- <widget class="QTreeView" name="treeView" />
- </item>
-
- <item>
- <layout class="QHBoxLayout">
- <!-- Add cookie button. -->
- <item>
- <widget class="QPushButton" name="addCookieButton">
- <property name="text">
- <string>&Add cookie</string>
- </property>
-
- <property name="icon">
- <iconset theme="list-add" />
- </property>
- </widget>
- </item>
-
- <!-- Edit cookie button. -->
- <item>
- <widget class="QPushButton" name="editCookieButton">
- <property name="text">
- <string>&Edit cookie</string>
- </property>
-
- <property name="icon">
- <iconset theme="edit-entry" />
- </property>
- </widget>
- </item>
-
- <!-- Delete domain button. -->
- <item>
- <widget class="QPushButton" name="deleteCookieButton">
- <property name="text">
- <string>De&lete cookie</string>
- </property>
-
- <property name="icon">
- <iconset theme="list-remove" />
- </property>
- </widget>
- </item>
-
- <!-- Close button. -->
- <item>
- <widget class="QDialogButtonBox" name="dialogButtonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Close</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
- Privacy Browser PC 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.
-
- Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
-
-<ui version="4.0">
- <class>DomainSettingsDialog</class>
-
- <widget class="QWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <height>1000</height>
- <width>1500</width>
- </rect>
- </property>
-
- <!-- Main layout. -->
- <layout class="QHBoxLayout">
- <item>
- <layout class="QVBoxLayout">
- <!-- Domains list view. -->
- <item>
- <widget class="QListView" name="domainsListView"/>
- </item>
-
- <!-- Domain buttons. -->
- <item>
- <layout class="QHBoxLayout">
- <!-- Add domain button. -->
- <item>
- <widget class="QPushButton" name="addDomainButton">
- <property name="text">
- <string>Add domain</string>
- </property>
-
- <property name="icon">
- <iconset theme="list-add" />
- </property>
- </widget>
- </item>
-
- <!-- Delete domain button. -->
- <item>
- <widget class="QPushButton" name="deleteDomainButton">
- <property name="text">
- <string>Delete domain</string>
- </property>
-
- <property name="icon">
- <iconset theme="list-remove" />
- </property>
- </widget>
- </item>
-
- <!-- Spacer. -->
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </item>
-
- <item>
- <layout class="QVBoxLayout">
- <item>
- <widget class="QWidget" name="domainSettingsWidget">
- <!-- Domain settings form layout. -->
- <layout class="QFormLayout">
- <!-- Domain name. -->
- <item row="0" column="0">
- <widget class="QLabel" name="domainNameLabel">
- <property name="text">
- <string>Domain name</string>
- </property>
- </widget>
- </item>
-
- <item row="0" column="1">
- <widget class="KLineEdit" name="domainNameLineEdit">
- <property name="toolTip">
- <string>*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com).</string>
- </property>
- </widget>
- </item>
-
- <!-- JavaScript. -->
- <item row="1" column="0">
- <widget class="QLabel">
- <property name="text">
- <string>JavaScript</string>
- </property>
- </widget>
- </item>
-
- <item row="1" column="1">
- <widget class="QComboBox" name="javaScriptComboBox">
- <property name="toolTip">
- <string>JavaScript allows websites to run programs (scripts) on the device.</string>
- </property>
-
- <item>
- <property name="text">
- <string>System default</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>JavaScript disabled</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>JavaScript enabled</string>
- </property>
- </item>
- </widget>
- </item>
-
- <item row="2" column="1">
- <widget class="QLabel" name="javaScriptLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
- </widget>
- </item>
-
- <!-- Local storage. -->
- <item row="3" column="0">
- <widget class="QLabel">
- <property name="text">
- <string>Local storage</string>
- </property>
- </widget>
- </item>
-
- <item row="3" column="1">
- <widget class="QComboBox" name="localStorageComboBox">
- <property name="toolTip">
- <string>Local storage, sometimes also called DOM storage, is like cookies on steroids.</string>
- </property>
-
- <item>
- <property name="text">
- <string>System default</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Local storage disabled</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Local storage enabled</string>
- </property>
- </item>
- </widget>
- </item>
-
- <item row="4" column="1">
- <widget class="QLabel" name="localStorageLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
- </widget>
- </item>
-
- <!-- User agent. -->
- <item row="5" column="0">
- <widget class="QLabel">
- <property name="text">
- <string>User agent</string>
- </property>
- </widget>
- </item>
-
- <item row="5" column="1">
- <widget class="QComboBox" name="userAgentComboBox">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
-
- <property name="editable">
- <bool>true</bool>
- </property>
-
- <item>
- <property name="text">
- <string>System default</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Privacy Browser</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>WebEngine default</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Firefox on Linux</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Chromium on Linux</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Firefox on Windows</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Chrome on Windows</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Edge on Windows</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Safari on macOS</string>
- </property>
- </item>
- </widget>
- </item>
-
- <item row="6" column="1">
- <widget class="QLabel" name="userAgentLabel">
- <property name="textFormat">
- <enum>Qt::RichText</enum>
- </property>
- </widget>
- </item>
-
- <!-- Zoom factor. -->
- <item row="7" column="0">
- <widget class="QLabel">
- <property name="text">
- <string>Zoom factor</string>
- </property>
- </widget>
- </item>
-
- <item row="7" column="1">
- <widget class="QComboBox" name="zoomFactorComboBox">
- <item>
- <property name="text">
- <string>System default</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Custom</string>
- </property>
- </item>
- </widget>
- </item>
-
- <item row="8" column="1">
- <widget class="QDoubleSpinBox" name="customZoomFactorSpinBox">
- <property name="toolTip">
- <string>Set the zoom factor between 0.25 and 5.00. The default is 1.00.</string>
- </property>
-
- <property name="minimum">
- <double>0.250000000000000</double>
- </property>
-
- <property name="maximum">
- <double>5.000000000000000</double>
- </property>
-
- <property name="singleStep">
- <double>0.250000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
-
- <!-- Spacer. -->
- <item>
- <spacer>
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- </spacer>
- </item>
-
- <!-- Dialog buttons. -->
- <item>
- <widget class="QDialogButtonBox" name="dialogButtonBox">
- <property name="standardButtons">
- <set>QDialogButtonBox::Reset | QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel</set>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
- Privacy Browser PC 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.
-
- Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
-
-<ui version="4.0">
- <!-- The name of the generated class. -->
- <class>GeneralSettings</class>
-
- <widget class="QWidget">
- <layout class="QFormLayout">
- <!-- Homepage. -->
- <item row="0" column="0">
- <widget class="QLabel" name="homepageLabel">
- <property name="text">
- <string>Homepage</string>
- </property>
- </widget>
- </item>
-
- <item row="0" column="1">
- <widget class="KLineEdit" name="kcfg_homepage">
- <property name="toolTip">
- <string>The default is https://www.mojeek.com/.</string>
- </property>
- </widget>
- </item>
-
- <!-- Search engine. -->
- <item row="1" column="0">
- <widget class="QLabel">
- <property name="text">
- <string>Search engine</string>
- </property>
- </widget>
- </item>
-
- <item row="1" column="1">
- <widget class="QComboBox" name="kcfg_searchEngine">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
-
- <property name="toolTip">
- <string>The default is Mojeek.</string>
- </property>
-
- <property name="editable">
- <bool>true</bool>
- </property>
-
- <item>
- <property name="text">
- <string>Mojeek</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Monocles</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>MetaGer</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Google</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Bing</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Yahoo</string>
- </property>
- </item>
- </widget>
- </item>
-
- <item row="2" column="1">
- <widget class="QLabel" name="searchEngineLabel">
- <property name="textInteractionFlags">
- <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
- </property>
- </widget>
- </item>
-
- <!-- Zoom factor. -->
- <item row="3" column="0">
- <widget class="QLabel" name="zoomFactorLabel">
- <property name="text">
- <string>Zoom factor</string>
- </property>
- </widget>
- </item>
-
- <item row="3" column="1">
- <widget class="QDoubleSpinBox" name="kcfg_zoomFactor">
- <property name="toolTip">
- <string>Set the zoom factor between 0.25 and 5.00. The default is 1.00.</string>
- </property>
-
- <property name="minimum">
- <double>0.250000000000000</double>
- </property>
-
- <property name="maximum">
- <double>5.000000000000000</double>
- </property>
-
- <property name="singleStep">
- <double>0.250000000000000</double>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
-</ui>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
-
- This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
-
- Privacy Browser PC 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.
-
- Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
-
-<ui version="4.0">
- <!-- The name of the generated class. -->
- <class>PrivacySettings</class>
-
- <widget class="QWidget">
- <layout class="QFormLayout">
- <!-- JavaScript. -->
- <item row="0" column="1">
- <widget class="QCheckBox" name="kcfg_javaScript">
- <property name="text">
- <string>JavaScript</string>
- </property>
-
- <property name="toolTip">
- <string>JavaScript allows websites to run programs (scripts) on the device. The default is disabled.</string>
- </property>
- </widget>
- </item>
-
- <!-- Local storage. -->
- <item row="1" column="1">
- <widget class="QCheckBox" name="kcfg_localStorage">
- <property name="text">
- <string>Local storage</string>
- </property>
-
- <property name="toolTip">
- <string>Local storage, sometimes also called DOM storage, is like cookies on steroids.</string>
- </property>
- </widget>
- </item>
-
- <!-- User agent. -->
- <item row="2" column="0">
- <widget class="QLabel">
- <property name="text">
- <string>User agent</string>
- </property>
- </widget>
- </item>
-
- <item row="2" column="1">
- <widget class="QComboBox" name="kcfg_userAgent">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
-
- <property name="toolTip">
- <string>The default is Privacy Browser.</string>
- </property>
-
- <property name="editable">
- <bool>true</bool>
- </property>
-
- <item>
- <property name="text">
- <string>Privacy Browser</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>WebEngine Default</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Firefox Linux</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Chromium Linux</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Firefox Windows</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Chrome Windows</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Edge Windows</string>
- </property>
- </item>
-
- <item>
- <property name="text">
- <string>Safari macOS</string>
- </property>
- </item>
- </widget>
- </item>
-
- <item row="3" column="1">
- <widget class="QLabel" name="userAgentLabel">
- <property name="textInteractionFlags">
- <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
-</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+ Privacy Browser PC 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.
+
+ Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
+
+<ui version="4.0">
+ <class>AddOrEditCookieDialog</class>
+
+ <widget class="QWidget">
+ <layout class="QVBoxLayout">
+ <item>
+ <!-- First row. -->
+ <layout class="QHBoxLayout">
+ <property name="alignment">
+ <enum>Qt::AlignLeft</enum>
+ </property>
+
+ <!-- Domain. -->
+ <item>
+ <widget class="QLabel">
+ <property name="toolTip">
+ <string>Cookies prepended by a period are accessible to all subdomains.</string>
+ </property>
+
+ <property name="text">
+ <string>Domain</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLineEdit" name="domainLineEdit" />
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+
+ <!-- Spacer label. -->
+ <property name="text">
+ <string>&nbsp;&nbsp;&nbsp;</string>
+ </property>
+ </widget>
+ </item>
+
+ <!-- Name. -->
+ <item>
+ <widget class="QLabel">
+ <property name="toolTip">
+ <string>The name identifies the cookie. Each cookie has a unique combination of domain, name, and path.</string>
+ </property>
+
+ <property name="text">
+ <string>Name</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLineEdit" name="nameLineEdit" />
+ </item>
+ </layout>
+ </item>
+
+ <!-- Second row. -->
+ <item>
+ <layout class="QHBoxLayout">
+ <property name="alignment">
+ <enum>Qt::AlignLeft</enum>
+ </property>
+
+ <!-- Path. -->
+ <item>
+ <widget class="QLabel">
+ <property name="toolTip">
+ <string>Websites can restrict cookie access to subpath of their URL.</string>
+ </property>
+
+ <property name="text">
+ <string>Path</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLineEdit" name="pathLineEdit">
+ <property name="text">
+ <string>/</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+
+ <!-- Spacer label. -->
+ <property name="text">
+ <string>&nbsp;&nbsp;&nbsp;</string>
+ </property>
+ </widget>
+ </item>
+
+ <!-- Expiration date. -->
+ <item>
+ <widget class="QCheckBox" name="expirationCheckBox">
+ <property name="toolTip">
+ <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="toolTip">
+ <string>Cookies without an expiration date are known as session cookies and are expected to be deleted every time the browser closes.</string>
+ </property>
+
+ <property name="text">
+ <string>Expiration date</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+
+ <!-- Spacer label. -->
+ <property name="text">
+ <string>&nbsp;</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QDateTimeEdit" name="expirationDateTimeEdit">
+ <property name="dateTime">
+ <datetime>
+ <year>2030</year>
+ <month>1</month>
+ <day>1</day>
+ <hour>0</hour>
+ <minute>0</minute>
+ <second>0</second>
+ </datetime>
+ </property>
+
+ <property name="calendarPopup">
+ <bool>true</bool>
+ </property>
+
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+
+ <!-- Spacer label. -->
+ <property name="text">
+ <string>&nbsp;&nbsp;&nbsp;</string>
+ </property>
+ </widget>
+ </item>
+
+ <!-- HTTP only. -->
+ <item>
+ <widget class="QCheckBox" name="httpOnlyCheckBox">
+ <property name="toolTip">
+ <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
+ </property>
+
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="toolTip">
+ <string>Restrict cookie access to HTTP (and HTTPS). This prevents JavaScript from accessing the cookie, which hardens it against cross-site scripting attacks.</string>
+ </property>
+
+ <property name="text">
+ <string>HTTP only</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+
+ <!-- Spacer label. -->
+ <property name="text">
+ <string>&nbsp;&nbsp;&nbsp;</string>
+ </property>
+ </widget>
+ </item>
+
+ <!-- Secure. -->
+ <item>
+ <widget class="QCheckBox" name="secureCheckBox">
+ <property name="toolTip">
+ <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
+ </property>
+
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLabel">
+ <property name="toolTip">
+ <string>Only allow the cookie to be transferred across HTTPS (as opposed to HTTP).</string>
+ </property>
+
+ <property name="text">
+ <string>Secure</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+
+ <!-- Third row. -->
+ <item>
+ <layout class="QHBoxLayout">
+ <property name="alignment">
+ <enum>Qt::AlignLeft</enum>
+ </property>
+
+ <!-- Value. -->
+ <item>
+ <widget class="QLabel">
+ <property name="toolTip">
+ <string>The value contains the cookie data.</string>
+ </property>
+
+ <property name="text">
+ <string>Value</string>
+ </property>
+ </widget>
+ </item>
+
+ <item>
+ <widget class="QLineEdit" name="valueLineEdit" />
+ </item>
+ </layout>
+ </item>
+
+ <!-- Spacer. -->
+ <item>
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </spacer>
+ </item>
+
+ <!-- Dialog buttons. -->
+ <item>
+ <widget class="QDialogButtonBox" name="dialogButtonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Save | QDialogButtonBox::Cancel</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+ Privacy Browser PC 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.
+
+ Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
+
+<ui version="4.0">
+ <class>BrowserView</class>
+ <!-- Main widget. -->
+ <widget class="QWidget">
+ <!-- Main layout. -->
+ <layout class="QVBoxLayout">
+ <!-- Set the spacing between items to 0. -->
+ <property name="spacing">
+ <number>0</number>
+ </property>
+
+ <!-- Set the margins to 0. -->
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
+
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+
+ <!-- WebEngine view. -->
+ <item>
+ <widget class="QWebEngineView" name="webEngineView" />
+ </item>
+ </layout>
+ </widget>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+ Privacy Browser PC 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.
+
+ Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
+
+<ui version="4.0">
+ <class>CookiesDialog</class>
+
+
+ <widget class="QWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <height>1000</height>
+ <width>1500</width>
+ </rect>
+ </property>
+
+ <layout class="QVBoxLayout">
+ <item>
+ <!-- Scroll area. -->
+ <widget class="QTreeView" name="treeView" />
+ </item>
+
+ <item>
+ <layout class="QHBoxLayout">
+ <!-- Add cookie button. -->
+ <item>
+ <widget class="QPushButton" name="addCookieButton">
+ <property name="text">
+ <string>&Add cookie</string>
+ </property>
+
+ <property name="icon">
+ <iconset theme="list-add" />
+ </property>
+ </widget>
+ </item>
+
+ <!-- Edit cookie button. -->
+ <item>
+ <widget class="QPushButton" name="editCookieButton">
+ <property name="text">
+ <string>&Edit cookie</string>
+ </property>
+
+ <property name="icon">
+ <iconset theme="edit-entry" />
+ </property>
+ </widget>
+ </item>
+
+ <!-- Delete domain button. -->
+ <item>
+ <widget class="QPushButton" name="deleteCookieButton">
+ <property name="text">
+ <string>De&lete cookie</string>
+ </property>
+
+ <property name="icon">
+ <iconset theme="list-remove" />
+ </property>
+ </widget>
+ </item>
+
+ <!-- Close button. -->
+ <item>
+ <widget class="QDialogButtonBox" name="dialogButtonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Close</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+ Privacy Browser PC 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.
+
+ Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
+
+<ui version="4.0">
+ <class>DomainSettingsDialog</class>
+
+ <widget class="QWidget">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <height>1000</height>
+ <width>1500</width>
+ </rect>
+ </property>
+
+ <!-- Main layout. -->
+ <layout class="QHBoxLayout">
+ <item>
+ <layout class="QVBoxLayout">
+ <!-- Domains list view. -->
+ <item>
+ <widget class="QListView" name="domainsListView"/>
+ </item>
+
+ <!-- Domain buttons. -->
+ <item>
+ <layout class="QHBoxLayout">
+ <!-- Add domain button. -->
+ <item>
+ <widget class="QPushButton" name="addDomainButton">
+ <property name="text">
+ <string>Add domain</string>
+ </property>
+
+ <property name="icon">
+ <iconset theme="list-add" />
+ </property>
+ </widget>
+ </item>
+
+ <!-- Delete domain button. -->
+ <item>
+ <widget class="QPushButton" name="deleteDomainButton">
+ <property name="text">
+ <string>Delete domain</string>
+ </property>
+
+ <property name="icon">
+ <iconset theme="list-remove" />
+ </property>
+ </widget>
+ </item>
+
+ <!-- Spacer. -->
+ <item>
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+
+ <item>
+ <layout class="QVBoxLayout">
+ <item>
+ <widget class="QWidget" name="domainSettingsWidget">
+ <!-- Domain settings form layout. -->
+ <layout class="QFormLayout">
+ <!-- Domain name. -->
+ <item row="0" column="0">
+ <widget class="QLabel" name="domainNameLabel">
+ <property name="text">
+ <string>Domain name</string>
+ </property>
+
+ <property name="toolTip">
+ <string>*. may be prepended to a domain to include all subdomains (eg. *.stoutner.com).</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="0" column="1">
+ <widget class="KLineEdit" name="domainNameLineEdit" />
+ </item>
+
+ <!-- JavaScript. -->
+ <item row="1" column="0">
+ <widget class="QLabel">
+ <property name="text">
+ <string>JavaScript</string>
+ </property>
+
+ <property name="toolTip">
+ <string>JavaScript allows websites to run programs (scripts) on the device.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="1" column="1">
+ <widget class="QComboBox" name="javaScriptComboBox">
+ <item>
+ <property name="text">
+ <string>System default</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>JavaScript disabled</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>JavaScript enabled</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+
+ <item row="2" column="1">
+ <widget class="QLabel" name="javaScriptLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+ </widget>
+ </item>
+
+ <!-- Cookies storage. -->
+ <item row="3" column="0">
+ <widget class="QLabel">
+ <property name="text">
+ <string>Cookies</string>
+ </property>
+
+ <property name="toolTip">
+ <string>Local storage includes cookies, IndexedDB, DOM storage, filesystem API, and service workers. DOM storage also requires a separate control to be enabled. Local storage is disabled by default.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="3" column="1">
+ <widget class="QComboBox" name="cookiesComboBox">
+ <item>
+ <property name="text">
+ <string>System default</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Cookies enabled</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Cookies disabled</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+
+ <item row="4" column="1">
+ <widget class="QLabel" name="cookiesLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+ </widget>
+ </item>
+
+ <!-- DOM storage. -->
+ <item row="5" column="0">
+ <widget class="QLabel">
+ <property name="text">
+ <string>DOM storage</string>
+ </property>
+
+ <property name="toolTip">
+ <string>DOM storage, sometimes called web storage, is like cookies on steroids. To function, it requires that both JavaScript and local storage be enabled.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="5" column="1">
+ <widget class="QComboBox" name="domStorageComboBox">
+ <item>
+ <property name="text">
+ <string>System default</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>DOM storage disabled</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>DOM storage enabled</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+
+ <item row="6" column="1">
+ <widget class="QLabel" name="domStorageLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+ </widget>
+ </item>
+
+ <!-- User agent. -->
+ <item row="7" column="0">
+ <widget class="QLabel">
+ <property name="text">
+ <string>User agent</string>
+ </property>
+
+ <property name="toolTip">
+ <string>The user agent identifies the browser to the web server. It serves no useful purpose, but many web servers refuse to return the web page if they don't see a user agent they like.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="7" column="1">
+ <widget class="QComboBox" name="userAgentComboBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+
+ <item>
+ <property name="text">
+ <string>System default</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Privacy Browser</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>WebEngine default</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Firefox on Linux</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Chromium on Linux</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Firefox on Windows</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Chrome on Windows</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Edge on Windows</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Safari on macOS</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+
+ <item row="8" column="1">
+ <widget class="QLabel" name="userAgentLabel">
+ <property name="textFormat">
+ <enum>Qt::RichText</enum>
+ </property>
+ </widget>
+ </item>
+
+ <!-- Zoom factor. -->
+ <item row="9" column="0">
+ <widget class="QLabel">
+ <property name="text">
+ <string>Zoom factor</string>
+ </property>
+
+ <property name="toolTip">
+ <string>Set the zoom factor between 0.25 and 5.00.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="9" column="1">
+ <widget class="QComboBox" name="zoomFactorComboBox">
+ <item>
+ <property name="text">
+ <string>System default</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Custom</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+
+ <item row="10" column="1">
+ <widget class="QDoubleSpinBox" name="customZoomFactorSpinBox">
+ <property name="minimum">
+ <double>0.250000000000000</double>
+ </property>
+
+ <property name="maximum">
+ <double>5.000000000000000</double>
+ </property>
+
+ <property name="singleStep">
+ <double>0.250000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+
+ <!-- Spacer. -->
+ <item>
+ <spacer>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </spacer>
+ </item>
+
+ <!-- Dialog buttons. -->
+ <item>
+ <widget class="QDialogButtonBox" name="dialogButtonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Reset | QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+ Privacy Browser PC 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.
+
+ Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
+
+<ui version="4.0">
+ <!-- The name of the generated class. -->
+ <class>GeneralSettings</class>
+
+ <widget class="QWidget">
+ <layout class="QFormLayout">
+ <!-- Homepage. -->
+ <item row="0" column="0">
+ <widget class="QLabel" name="homepageLabel">
+ <property name="text">
+ <string>Homepage</string>
+ </property>
+
+ <property name="toolTip">
+ <string>The default is https://www.mojeek.com/.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="0" column="1">
+ <widget class="KLineEdit" name="kcfg_homepage" />
+ </item>
+
+ <!-- Search engine. -->
+ <item row="1" column="0">
+ <widget class="QLabel">
+ <property name="text">
+ <string>Search engine</string>
+ </property>
+
+ <property name="toolTip">
+ <string>The default is Mojeek.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="1" column="1">
+ <widget class="QComboBox" name="kcfg_searchEngine">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+
+ <item>
+ <property name="text">
+ <string>Mojeek</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Monocles</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>MetaGer</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Google</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Bing</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Yahoo</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+
+ <item row="2" column="1">
+ <widget class="QLabel" name="searchEngineLabel">
+ <property name="textInteractionFlags">
+ <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+
+ <!-- Zoom factor. -->
+ <item row="3" column="0">
+ <widget class="QLabel" name="zoomFactorLabel">
+ <property name="text">
+ <string>Zoom factor</string>
+ </property>
+
+ <property name="toolTip">
+ <string>Set the zoom factor between 0.25 and 5.00. The default is 1.00.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="3" column="1">
+ <widget class="QDoubleSpinBox" name="kcfg_zoomFactor">
+
+ <property name="minimum">
+ <double>0.250000000000000</double>
+ </property>
+
+ <property name="maximum">
+ <double>5.000000000000000</double>
+ </property>
+
+ <property name="singleStep">
+ <double>0.250000000000000</double>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+</ui>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright © 2022 Soren Stoutner <soren@stoutner.com>.
+
+ This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-android>.
+
+ Privacy Browser PC 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.
+
+ Privacy Browser PC 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 Privacy Browser PC. If not, see <http://www.gnu.org/licenses/>. -->
+
+<ui version="4.0">
+ <!-- The name of the generated class. -->
+ <class>PrivacySettings</class>
+
+ <widget class="QWidget">
+ <layout class="QFormLayout">
+ <!-- JavaScript. -->
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="kcfg_javaScriptEnabled">
+ <property name="text">
+ <string>JavaScript</string>
+ </property>
+
+ <property name="toolTip">
+ <string>JavaScript allows websites to run programs (scripts) on the device. The default is disabled.</string>
+ </property>
+ </widget>
+ </item>
+
+ <!-- Cookies. -->
+ <item row="1" column="1">
+ <widget class="QCheckBox" name="kcfg_cookiesEnabled">
+ <property name="text">
+ <string>Cookies</string>
+ </property>
+
+ <property name="toolTip">
+ <string>Local storage includes cookies, IndexedDB, DOM storage, filesystem API, and service workers. DOM storage also requires a separate control to be enabled. Local storage is disabled by default.</string>
+ </property>
+ </widget>
+ </item>
+
+ <!-- DOM storage. -->
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="kcfg_domStorageEnabled">
+ <property name="text">
+ <string>DOM storage</string>
+ </property>
+
+ <property name="toolTip">
+ <string>DOM storage, sometimes called web storage, is like cookies on steroids. To function, it requires that both JavaScript and local storage be enabled. It is disabled by default.</string>
+ </property>
+ </widget>
+ </item>
+
+ <!-- User agent. -->
+ <item row="3" column="0">
+ <widget class="QLabel">
+ <property name="text">
+ <string>User agent</string>
+ </property>
+
+ <property name="toolTip">
+ <string>The user agent identifies the browser to the web server. It serves no useful purpose, but many web servers refuse to return the web page if they don't see a user agent they like. The default is Privacy Browser.</string>
+ </property>
+ </widget>
+ </item>
+
+ <item row="3" column="1">
+ <widget class="QComboBox" name="kcfg_userAgent">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+
+ <item>
+ <property name="text">
+ <string>Privacy Browser</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>WebEngine Default</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Firefox Linux</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Chromium Linux</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Firefox Windows</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Chrome Windows</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Edge Windows</string>
+ </property>
+ </item>
+
+ <item>
+ <property name="text">
+ <string>Safari macOS</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+
+ <item row="4" column="1">
+ <widget class="QLabel" name="userAgentLabel">
+ <property name="textInteractionFlags">
+ <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+</ui>
// Initialize the public static variables.
QString BrowserView::webEngineDefaultUserAgent = QStringLiteral("");
+// Construct the class.
BrowserView::BrowserView(QWidget *parent) : QWidget(parent)
{
+ // Initialize the variables.
+ privacyWebEngineListPointer = new QList<PrivacyWebEngine*>;
+
// Instantiate the browser view UI.
Ui::BrowserView browserViewUi;
webEngineSettingsPointer = webEngineViewPointer->settings();
webEngineCookieStorePointer = webEngineProfilePointer->cookieStore();
+ // Initialize the current privacy web engine pointer.
+ currentPrivacyWebEnginePointer = new PrivacyWebEngine(webEngineViewPointer);
+
+ // Populate the privacy web engine list.
+ privacyWebEngineListPointer->append(currentPrivacyWebEnginePointer);
+
+ // Set the cookie filter.
+ webEngineCookieStorePointer->setCookieFilter([this](const QWebEngineCookieStore::FilterRequest &filterRequest)
+ {
+ // qDebug() << "Cookie page URL: " << filterRequest.firstPartyUrl << ", Cookie URL: " << filterRequest.origin << ", Is third-party: " << filterRequest.thirdParty;
+
+ // Block all third party local storage requests, including the sneaky ones that don't register a first party URL.
+ if (filterRequest.thirdParty || (filterRequest.firstPartyUrl == QStringLiteral("")))
+ return false;
+
+ // Check each tab to see if this local storage request should be allowed.
+ for (PrivacyWebEngine *privacyWebEnginePointer : *privacyWebEngineListPointer)
+ {
+ // Allow this local storage request if it comes from a tab with local storage enabled.
+ if (privacyWebEnginePointer->cookiesEnabled && (webEngineViewPointer->url().host() == filterRequest.firstPartyUrl.host()))
+ return true;
+ }
+
+ // Block any remaining local storage requests.
+ return false;
+ });
+
// Process cookie changes.
connect(webEngineCookieStorePointer, SIGNAL(cookieAdded(QNetworkCookie)), this, SLOT(cookieAdded(QNetworkCookie)));
connect(webEngineCookieStorePointer, SIGNAL(cookieRemoved(QNetworkCookie)), this, SLOT(cookieRemoved(QNetworkCookie)));
case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
{
// Set the default JavaScript status.
- webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScript());
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScriptEnabled());
break;
}
}
}
- // Set local storage.
- switch (domainRecord.field(DomainsDatabaseHelper::LOCAL_STORAGE).value().toInt())
+ // Set the cookie status. TODO.
+ currentPrivacyWebEnginePointer->cookiesEnabled = Settings::cookiesEnabled();
+
+ // Set DOM storage.
+ switch (domainRecord.field(DomainsDatabaseHelper::DOM_STORAGE).value().toInt())
{
case (DomainsDatabaseHelper::SYSTEM_DEFAULT):
{
- // Set the default local storage status.
- webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::localStorage());
+ // Set the default DOM storage status.
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::domStorageEnabled());
break;
}
case (DomainsDatabaseHelper::DISABLED):
{
- // Disable local storage.
+ // Disable DOM storage.
webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, false);
break;
case (DomainsDatabaseHelper::ENABLED):
{
- // Enable local storage.
+ // Enable DOM storage.
webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
break;
else // The hostname does not have domain settings.
{
// Set the JavaScript status.
- webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScript());
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::JavascriptEnabled, Settings::javaScriptEnabled());
+
+ // Set the cookie status.
+ currentPrivacyWebEnginePointer->cookiesEnabled = Settings::cookiesEnabled();
- // Set local storage.
- webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::localStorage());
+ // Set DOM storage.
+ webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, Settings::domStorageEnabled());
// Set the user agent.
webEngineProfilePointer->setHttpUserAgent(UserAgentHelper::getUserAgentFromDatabaseName(Settings::userAgent()));
// Emit the update actions signals.
emit updateJavaScriptAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::JavascriptEnabled));
- emit updateLocalStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
+ emit updateCookiesAction(currentPrivacyWebEnginePointer->cookiesEnabled);
+ emit updateDomStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
emit updateUserAgentActions(webEngineProfilePointer->httpUserAgent());
emit updateZoomFactorAction(webEngineViewPointer->zoomFactor());
webEngineViewPointer->reload();
}
+void BrowserView::toggleCookies()
+{
+ // Toggle cookies.
+ currentPrivacyWebEnginePointer->cookiesEnabled = !currentPrivacyWebEnginePointer->cookiesEnabled;
+
+ // Update the cookies icon.
+ emit updateCookiesAction(currentPrivacyWebEnginePointer->cookiesEnabled);
+
+ // Reload the website.
+ webEngineViewPointer->reload();
+}
+
void BrowserView::toggleJavaScript() const
{
// Toggle JavaScript.
webEngineViewPointer->reload();
}
-void BrowserView::toggleLocalStorage() const
+void BrowserView::toggleDomStorage() const
{
- // Toggle local storage.
+ // Toggle DOM storage.
webEngineSettingsPointer->setAttribute(QWebEngineSettings::LocalStorageEnabled, !webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
- // Update the local storage icon.
- emit updateLocalStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
+ // Update the DOM storage action icon.
+ emit updateDomStorageAction(webEngineSettingsPointer->testAttribute(QWebEngineSettings::LocalStorageEnabled));
// Reload the website.
webEngineViewPointer->reload();
#ifndef BROWSERVIEW_H
#define BROWSERVIEW_H
+// Application headers.
+#include "structs/PrivacyWebEngine.h"
+
// KDE Framework headers.
#include <KLineEdit>
-// Qt framework headers.
+// Qt toolkit headers.
#include <QPushButton>
#include <QWebEngineHistory>
#include <QWebEngineProfile>
// The public functions.
void applyOnTheFlyZoomFactor(const double &zoomFactor);
void loadInitialWebsite();
+ void toggleCookies();
+ void toggleDomStorage() const;
void toggleJavaScript() const;
- void toggleLocalStorage() const;
// The public static variables.
static QString webEngineDefaultUserAgent;
void linkHovered(const QString &linkUrl) const;
void showProgressBar(const int &progress) const;
void updateBackAction(const bool &isEnabled) const;
+ void updateCookiesAction(const bool &isEnabled) const;
+ void updateDomStorageAction(const bool &isEnabled) const;
void updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain) const;
void updateForwardAction(const bool &isEnabled) const;
void updateJavaScriptAction(const bool &isEnabled) const;
- void updateLocalStorageAction(const bool &isEnabled) const;
void updateSearchEngineActions(const QString &searchEngine) const;
void updateUrlLineEdit(const QUrl &newUrl) const;
void updateUserAgentActions(const QString &userAgent) const;
private:
// The private variables.
double currentZoomFactor; // This can be removed once <https://redmine.stoutner.com/issues/799> has been resolved.
+ PrivacyWebEngine *currentPrivacyWebEnginePointer;
+ QList<PrivacyWebEngine*> *privacyWebEngineListPointer;
QString searchEngineUrl;
QWebEngineCookieStore *webEngineCookieStorePointer;
QWebEngineHistory *webEngineHistoryPointer;
#include <QNetworkCookie>
#include <QStatusBar>
+// Construct the class.
BrowserWindow::BrowserWindow() : KXmlGuiWindow()
{
+ // Initialize the variables.
+ cookieListPointer = new std::list<QNetworkCookie>;
+ cookiesEnabled = false;
+ javaScriptEnabled = false;
+
// Instantiate the main view pointer.
browserViewPointer = new BrowserView(this);
searchEngineYahooActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_yahoo"));
searchEngineCustomActionPointer = actionCollectionPointer->addAction(QStringLiteral("search_engine_custom"));
QAction *domainSettingsActionPointer = actionCollectionPointer->addAction(QStringLiteral("domain_settings"));
- QAction *cookiesActionPointer = actionCollectionPointer->addAction(QStringLiteral("cookies"));
+ cookiesActionPointer = actionCollectionPointer->addAction(QStringLiteral("cookies"));
javaScriptActionPointer = actionCollectionPointer->addAction(QStringLiteral("javascript"));
- localStorageActionPointer = actionCollectionPointer->addAction(QStringLiteral("local_storage"));
+ onTheFlyCookiesActionPointer = actionCollectionPointer->addAction(QStringLiteral("on-the-fly_cookies"));
+ domStorageActionPointer = actionCollectionPointer->addAction(QStringLiteral("dom_storage"));
// Create the action groups
QActionGroup *userAgentActionGroupPointer = new QActionGroup(this);
searchEngineYahooActionPointer->setCheckable(true);
searchEngineCustomActionPointer->setCheckable(true);
- // Set the non-mutable action text.
+ // Get the number of cookies.
+ int numberOfCookies = cookieListPointer->size();
+
+ // Set the action text.
userAgentPrivacyBrowserActionPointer->setText(UserAgentHelper::PRIVACY_BROWSER_TRANSLATED);
userAgentWebEngineDefaultActionPointer->setText(UserAgentHelper::WEB_ENGINE_DEFAULT_TRANSLATED);
userAgentFirefoxLinuxActionPointer->setText(UserAgentHelper::FIREFOX_LINUX_TRANSLATED);
searchEngineBingActionPointer->setText(i18nc("Search engine", "Bing"));
searchEngineYahooActionPointer->setText(i18nc("Search engine", "Yahoo"));
domainSettingsActionPointer->setText(i18nc("Domain Settings action", "Domain Settings"));
- cookiesActionPointer->setText(i18nc("Cookies action", "Cookies"));
+ cookiesActionPointer->setText(i18nc("The Cookies action, which also displays the number of cookies", "Cookies - %1", numberOfCookies));
javaScriptActionPointer->setText(i18nc("JavaScript action", "JavaScript"));
- localStorageActionPointer->setText(i18nc("Local Storage action", "Local Storage"));
+ onTheFlyCookiesActionPointer->setText(i18nc("The On-The-Fly Cookies action, which also display the number of cookies", "Cookies - %1", numberOfCookies));
+ domStorageActionPointer->setText(i18nc("DOM Storage action", "DOM Storage"));
// Set the action icons.
userAgentPrivacyBrowserActionPointer->setIcon(QIcon(":/icons/privacy-mode"));
zoomFactorActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("zoom")));
domainSettingsActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("settings-configure")));
cookiesActionPointer->setIcon(QIcon::fromTheme(QStringLiteral("preferences-web-browser-cookies")));
+ onTheFlyCookiesActionPointer->setIcon(QIcon(":/icons/cookies-off"));
// Update the on-the-fly menus.
connect(browserViewPointer, SIGNAL(updateUserAgentActions(QString)), this, SLOT(updateUserAgentActions(QString)));
// Connect the URL toolbar actions.
connect(javaScriptActionPointer, SIGNAL(triggered()), this, SLOT(toggleJavaScript()));
- connect(localStorageActionPointer, SIGNAL(triggered()), this, SLOT(toggleLocalStorage()));
+ connect(onTheFlyCookiesActionPointer, SIGNAL(triggered()), this, SLOT(toggleCookies()));
+ connect(domStorageActionPointer, SIGNAL(triggered()), this, SLOT(toggleDomStorage()));
// Update the URL toolbar actions.
connect(browserViewPointer, SIGNAL(updateBackAction(bool)), backActionPointer, SLOT(setEnabled(bool)));
connect(browserViewPointer, SIGNAL(updateForwardAction(bool)), forwardActionPointer, SLOT(setEnabled(bool)));
connect(browserViewPointer, SIGNAL(updateJavaScriptAction(bool)), this, SLOT(updateJavaScriptAction(bool)));
- connect(browserViewPointer, SIGNAL(updateLocalStorageAction(bool)), this, SLOT(updateLocalStorageAction(bool)));
+ connect(browserViewPointer, SIGNAL(updateCookiesAction(bool)), this, SLOT(updateCookiesAction(bool)));
+ connect(browserViewPointer, SIGNAL(updateDomStorageAction(bool)), this, SLOT(updateDomStorageAction(bool)));
// Setup the GUI based on the browser_ui.rc file.
setupGUI(StandardWindowOption::Default, ("browser_ui.rc"));
// Update the applied palette.
connect(browserViewPointer, SIGNAL(updateDomainSettingsIndicator(bool, QString)), this, SLOT(updateDomainSettingsIndicator(bool, QString)));
- // Initialize the cookie list.
- cookieListPointer = new std::forward_list<QNetworkCookie>;
-
// Process cookie changes.
connect(browserViewPointer, SIGNAL(addCookie(QNetworkCookie)), this, SLOT(addCookieToList(QNetworkCookie)));
connect(browserViewPointer, SIGNAL(removeCookie(QNetworkCookie)), this, SLOT(removeCookieFromList(QNetworkCookie)));
void BrowserWindow::addCookieToList(const QNetworkCookie &newCookie) const
{
qDebug() << "Add cookie: " << newCookie.toRawForm();
+
// Add the new cookie to the list.
cookieListPointer->push_front(newCookie);
+
+ // Get the number of cookies.
+ int numberOfCookies = cookieListPointer->size();
+
+ // Update the action text.
+ cookiesActionPointer->setText(i18nc("The Cookies action, which also displays the number of cookies", "Cookies - %1", numberOfCookies));
+ onTheFlyCookiesActionPointer->setText(i18nc("The On-The-Fly Cookies action, which also display the number of cookies", "Cookies - %1", numberOfCookies));
}
void BrowserWindow::addOrEditDomainSettings() const
// Remove the cookie from the list.
cookieListPointer->remove(cookie);
+
+ // Get the number of cookies.
+ int numberOfCookies = cookieListPointer->size();
+
+ // Update the action text.
+ cookiesActionPointer->setText(i18nc("The Cookies action, which also displays the number of cookies", "Cookies - %1", numberOfCookies));
+ onTheFlyCookiesActionPointer->setText(i18nc("The On-The-Fly Cookies action, which also display the number of cookies", "Cookies - %1", numberOfCookies));
}
void BrowserWindow::showProgressBar(const int &progress) const
}
}
+void BrowserWindow::toggleCookies() const
+{
+ // Remove the focus from teh URL line edit.
+ urlLineEditPointer->clearFocus();
+
+ // Toggle cookies.
+ browserViewPointer->toggleCookies();
+}
+
void BrowserWindow::toggleJavaScript() const
{
// Remove the focus from the URL line edit.
browserViewPointer->toggleJavaScript();
}
-void BrowserWindow::toggleLocalStorage() const
+void BrowserWindow::toggleDomStorage() const
{
// Remove the focus from the URL line edit.
urlLineEditPointer->clearFocus();
- // Toggle JavaScript.
- browserViewPointer->toggleLocalStorage();
+ // Toggle DOM storage.
+ browserViewPointer->toggleDomStorage();
+}
+
+void BrowserWindow::updateCookiesAction(const bool &isEnabled)
+{
+ // Update the cookies status.
+ cookiesEnabled = isEnabled;
+
+ // Update the icon.
+ if (cookiesEnabled)
+ onTheFlyCookiesActionPointer->setIcon(QIcon(":/icons/cookies-on"));
+ else
+ onTheFlyCookiesActionPointer->setIcon(QIcon(":/icons/cookies-off"));
+
+ // Update the status of the DOM storage action.
+ domStorageActionPointer->setEnabled(cookiesEnabled & javaScriptEnabled);
}
void BrowserWindow::updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain)
{
// Set the domain palette according to the status.
- if (status) urlLineEditPointer->setPalette(domainSettingsPalette);
- else urlLineEditPointer->setPalette(noDomainSettingsPalette);
+ if (status)
+ urlLineEditPointer->setPalette(domainSettingsPalette);
+ else
+ urlLineEditPointer->setPalette(noDomainSettingsPalette);
// Store the domain.
currentDomainSettingsDomain = domainSettingsDomain;
}
-void BrowserWindow::updateJavaScriptAction(const bool &isEnabled) const
+void BrowserWindow::updateJavaScriptAction(const bool &isEnabled)
{
+ // Update the JavaScript status.
+ javaScriptEnabled = isEnabled;
+
// Set the icon according to the status.
- if (isEnabled) javaScriptActionPointer->setIcon(QIcon(":/icons/javascript-warning"));
- else javaScriptActionPointer->setIcon(QIcon(":/icons/privacy-mode"));
+ if (javaScriptEnabled)
+ javaScriptActionPointer->setIcon(QIcon(":/icons/javascript-warning"));
+ else
+ javaScriptActionPointer->setIcon(QIcon(":/icons/privacy-mode"));
+
+ // Update the status of the DOM storage action.
+ domStorageActionPointer->setEnabled(javaScriptEnabled & cookiesEnabled);
}
-void BrowserWindow::updateLocalStorageAction(const bool &isEnabled) const
+void BrowserWindow::updateDomStorageAction(const bool &isEnabled) const
{
// Set the icon according to the status.
- if (isEnabled) localStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota-low"));
- else localStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota"));
+ if (isEnabled)
+ domStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota-low"));
+ else
+ domStorageActionPointer->setIcon(QIcon::fromTheme("disk-quota"));
}
void BrowserWindow::updateSearchEngineActions(const QString &searchEngine) const
#include <QProgressBar>
// C++ headers.
-#include <forward_list>
+#include <list>
class BrowserWindow : public KXmlGuiWindow
{
void removeCookieFromList(const QNetworkCookie &cookie) const;
void settingsConfigure();
void showProgressBar(const int &progress) const;
+ void toggleCookies() const;
+ void toggleDomStorage() const;
void toggleJavaScript() const;
- void toggleLocalStorage() const;
+ void updateCookiesAction(const bool &isEnabled);
+ void updateDomStorageAction(const bool &isEnabled) const;
void updateDomainSettingsIndicator(const bool &status, const QString &domainSettingsDomain);
- void updateJavaScriptAction(const bool &isEnabled) const;
- void updateLocalStorageAction(const bool &isEnabled) const;
+ void updateJavaScriptAction(const bool &isEnabled);
void updateSearchEngineActions(const QString &searchEngine) const;
void updateUserAgentActions(const QString &userAgent) const;
void updateZoomFactorAction(const double &zoomFactor);
// The private variables.
BrowserView *browserViewPointer;
KConfigDialog *configDialogPointer;
- std::forward_list<QNetworkCookie> *cookieListPointer;
+ std::list<QNetworkCookie> *cookieListPointer;
+ QAction *cookiesActionPointer;
+ bool cookiesEnabled;
QString currentDomainSettingsDomain;
QUrl currentUrl;
double currentZoomFactor;
+ QAction *domStorageActionPointer;
QPalette domainSettingsPalette;
QAction *javaScriptActionPointer;
- QAction *localStorageActionPointer;
+ bool javaScriptEnabled;
QPalette noDomainSettingsPalette;
+ QAction *onTheFlyCookiesActionPointer;
QProgressBar *progressBarPointer;
QLabel *searchEngineLabelPointer;
QAction *searchEngineMojeekActionPointer;