]> gitweb.stoutner.com Git - PrivacyBrowserPC.git/commitdiff
Add WebSocket filter list support. https://redmine.stoutner.com/issues/1198 master
authorSoren Stoutner <soren@stoutner.com>
Sun, 1 Jun 2025 00:38:36 +0000 (17:38 -0700)
committerSoren Stoutner <soren@stoutner.com>
Sun, 1 Jun 2025 00:38:36 +0000 (17:38 -0700)
23 files changed:
src/dialogs/CMakeLists.txt
src/dialogs/FilterEntryDialog.cpp
src/dialogs/FilterEntryDialog.h
src/dialogs/FilterListsDialog.cpp
src/dialogs/FilterListsDialog.h
src/dialogs/HttpAuthenticationDialog.cpp
src/dialogs/HttpAuthenticationDialog.h
src/dialogs/RequestDetailDialog.cpp
src/dialogs/RequestDetailDialog.h
src/dialogs/RequestsDialog.cpp
src/dialogs/RequestsDialog.h
src/helpers/CMakeLists.txt
src/helpers/FilterListHelper.cpp
src/helpers/FilterListHelper.h
src/helpers/FolderHelper.cpp
src/helpers/FolderHelper.h
src/structs/BookmarkStruct.h
src/structs/EntryStruct.h
src/structs/FilterListStruct.h
src/structs/OverrideStruct.h
src/structs/RequestStruct.h
src/uis/FilterEntryDialog.ui
src/uis/RequestDetailDialog.ui

index a0bc9eba6e3d0038d4a1170e303fd462e0a3de6f..e00ad1636a6cb07064906b7724e8fd3a2f9ac54a 100644 (file)
@@ -1,19 +1,20 @@
-# Copyright 2022-2024 Soren Stoutner <soren@stoutner.com>.
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: 2022-2024 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.
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
 #
-# 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.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
 #
-# You should have received a copy of the GNU General Public License
-# along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
 # List the sources to include in the executable.
index 0515f6410e1f747570f9688fd957cce829e69cf0..f20a15b8992570304fa496a74055f58f1b74306d 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
@@ -61,6 +61,7 @@ FilterEntryDialog::FilterEntryDialog(QWidget *parentWidgetPointer, QTableWidget
     scriptLineEditPointer = filterEntryDialogUi.scriptLineEdit;
     styleSheetLineEditPointer = filterEntryDialogUi.styleSheetLineEdit;
     subFrameLineEditPointer = filterEntryDialogUi.subFrameLineEdit;
+    webSocketLineEditPointer = filterEntryDialogUi.webSocketLineEdit;
     xmlHttpRequestLineEditPointer = filterEntryDialogUi.xmlHttpRequestLineEdit;
     appliedFilterOptionsLineEditPointer = filterEntryDialogUi.appliedFilterOptionsLineEdit;
     originalFilterOptionsLineEditPointer = filterEntryDialogUi.originalFilterOptionsLineEdit;
@@ -151,10 +152,11 @@ void FilterEntryDialog::populateDialog(const int row)
     scriptLineEditPointer->setText(tableWidgetPointer->item(row, 14)->text());
     styleSheetLineEditPointer->setText(tableWidgetPointer->item(row, 15)->text());
     subFrameLineEditPointer->setText(tableWidgetPointer->item(row, 16)->text());
-    xmlHttpRequestLineEditPointer->setText(tableWidgetPointer->item(row, 17)->text());
-    appliedFilterOptionsLineEditPointer->setText(tableWidgetPointer->item(row, 18)->text());
-    originalFilterOptionsLineEditPointer->setText(tableWidgetPointer->item(row, 19)->text());
-    originalEntryLineEditPointer->setText(tableWidgetPointer->item(row, 20)->text());
+    webSocketLineEditPointer->setText(tableWidgetPointer->item(row, 17)->text());
+    xmlHttpRequestLineEditPointer->setText(tableWidgetPointer->item(row, 18)->text());
+    appliedFilterOptionsLineEditPointer->setText(tableWidgetPointer->item(row, 19)->text());
+    originalFilterOptionsLineEditPointer->setText(tableWidgetPointer->item(row, 20)->text());
+    originalEntryLineEditPointer->setText(tableWidgetPointer->item(row, 21)->text());
 
     // Make a local copy of the has request options boolean.
     bool hasRequestOptions = tableWidgetPointer->item(row, 6)->text() == i18n("Yes");
@@ -179,6 +181,7 @@ void FilterEntryDialog::populateDialog(const int row)
     setFilterOptionBackgroundPalette(scriptLineEditPointer);
     setFilterOptionBackgroundPalette(styleSheetLineEditPointer);
     setFilterOptionBackgroundPalette(subFrameLineEditPointer);
+    setFilterOptionBackgroundPalette(webSocketLineEditPointer);
     setFilterOptionBackgroundPalette(xmlHttpRequestLineEditPointer);
 
     // Set the request option status.
@@ -192,6 +195,7 @@ void FilterEntryDialog::populateDialog(const int row)
     scriptLineEditPointer->setEnabled(hasRequestOptions);
     styleSheetLineEditPointer->setEnabled(hasRequestOptions);
     subFrameLineEditPointer->setEnabled(hasRequestOptions);
+    webSocketLineEditPointer->setEnabled(hasRequestOptions);
     xmlHttpRequestLineEditPointer->setEnabled(hasRequestOptions);
 
     // Set the domain list line edit to have the same palette as the domain line edit.
index 48bd6a7c5a04117207e6d0dcda3762b55dc0d5d8..273a21e7e9224cabcc9ba67244521585e0486134 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef FILTER_ENTRY_DIALOG_H
@@ -69,6 +69,7 @@ private:
     QLineEdit *subFrameLineEditPointer;
     QTableWidget *tableWidgetPointer;
     QLineEdit *thirdPartyLineEditPointer;
+    QLineEdit *webSocketLineEditPointer;
     QLineEdit *xmlHttpRequestLineEditPointer;
 
     // The private functions.
index 511f820d0885c68088978b64b17ea25f6615b5be..faf3b49d88265c007bc2bb18124f08e5378bfb90 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
@@ -200,7 +200,7 @@ void FilterListsDialog::populateTableWidget(int sublistComboBoxIndex) const
         }
 
         // Create the columns.
-        sublistTableWidgetPointer->setColumnCount(21);
+        sublistTableWidgetPointer->setColumnCount(22);
 
         // Create the table headers.
         QTableWidgetItem *appliedEntryListHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist applied entry list header", "Applied Entry List"));
@@ -220,6 +220,7 @@ void FilterListsDialog::populateTableWidget(int sublistComboBoxIndex) const
         QTableWidgetItem *scriptHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist script header", "Script"));
         QTableWidgetItem *styleSheetHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist style sheet header", "Style Sheet"));
         QTableWidgetItem *subFrameHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist sub frame header", "Sub Frame"));
+        QTableWidgetItem *webSocketHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist web socket header", "Web Socket"));
         QTableWidgetItem *xmlHttpRequestHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist XML HTTP request header", "XML HTTP Request"));
         QTableWidgetItem *appliedFilterOptionsHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist applied filter options header", "Applied Filter Options"));
         QTableWidgetItem *originalFilterOptionsHeaderItemPointer = new QTableWidgetItem(i18nc("Sublist original filter options header", "Original Filter Options"));
@@ -243,10 +244,11 @@ void FilterListsDialog::populateTableWidget(int sublistComboBoxIndex) const
         sublistTableWidgetPointer->setHorizontalHeaderItem(14, scriptHeaderItemPointer);
         sublistTableWidgetPointer->setHorizontalHeaderItem(15, styleSheetHeaderItemPointer);
         sublistTableWidgetPointer->setHorizontalHeaderItem(16, subFrameHeaderItemPointer);
-        sublistTableWidgetPointer->setHorizontalHeaderItem(17, xmlHttpRequestHeaderItemPointer);
-        sublistTableWidgetPointer->setHorizontalHeaderItem(18, appliedFilterOptionsHeaderItemPointer);
-        sublistTableWidgetPointer->setHorizontalHeaderItem(19, originalFilterOptionsHeaderItemPointer);
-        sublistTableWidgetPointer->setHorizontalHeaderItem(20, originalEntryHeaderItemPointer);
+        sublistTableWidgetPointer->setHorizontalHeaderItem(17, webSocketHeaderItemPointer);
+        sublistTableWidgetPointer->setHorizontalHeaderItem(18, xmlHttpRequestHeaderItemPointer);
+        sublistTableWidgetPointer->setHorizontalHeaderItem(19, appliedFilterOptionsHeaderItemPointer);
+        sublistTableWidgetPointer->setHorizontalHeaderItem(20, originalFilterOptionsHeaderItemPointer);
+        sublistTableWidgetPointer->setHorizontalHeaderItem(21, originalEntryHeaderItemPointer);
 
         // Initialize the row counter.
         int rowCounter = 0;
@@ -277,6 +279,7 @@ void FilterListsDialog::populateTableWidget(int sublistComboBoxIndex) const
             QTableWidgetItem *scriptItemPointer = new QTableWidgetItem(globalFilterListHelperPointer->getRequestOptionDispositionString(entryStructPointer->script));
             QTableWidgetItem *styleSheetItemPointer = new QTableWidgetItem(globalFilterListHelperPointer->getRequestOptionDispositionString(entryStructPointer->styleSheet));
             QTableWidgetItem *subFrameItemPointer = new QTableWidgetItem(globalFilterListHelperPointer->getRequestOptionDispositionString(entryStructPointer->subFrame));
+            QTableWidgetItem *webSocketItemPointer = new QTableWidgetItem(globalFilterListHelperPointer->getRequestOptionDispositionString(entryStructPointer->webSocket));
             QTableWidgetItem *xmlHttpRequestItemPointer = new QTableWidgetItem(globalFilterListHelperPointer->getRequestOptionDispositionString(entryStructPointer->xmlHttpRequest));
             QTableWidgetItem *appliedFilterOptionsItemPointer = new QTableWidgetItem(entryStructPointer->appliedFilterOptionsList.join(QLatin1String(" , ")));
             QTableWidgetItem *originalFilterOptionsItemPointer = new QTableWidgetItem(entryStructPointer->originalFilterOptions);
@@ -300,10 +303,11 @@ void FilterListsDialog::populateTableWidget(int sublistComboBoxIndex) const
             sublistTableWidgetPointer->setItem(rowCounter, 14, scriptItemPointer);
             sublistTableWidgetPointer->setItem(rowCounter, 15, styleSheetItemPointer);
             sublistTableWidgetPointer->setItem(rowCounter, 16, subFrameItemPointer);
-            sublistTableWidgetPointer->setItem(rowCounter, 17, xmlHttpRequestItemPointer);
-            sublistTableWidgetPointer->setItem(rowCounter, 18, appliedFilterOptionsItemPointer);
-            sublistTableWidgetPointer->setItem(rowCounter, 19, originalFilterOptionsItemPointer);
-            sublistTableWidgetPointer->setItem(rowCounter, 20, originalEntryItemPointer);
+            sublistTableWidgetPointer->setItem(rowCounter, 17, webSocketItemPointer);
+            sublistTableWidgetPointer->setItem(rowCounter, 18, xmlHttpRequestItemPointer);
+            sublistTableWidgetPointer->setItem(rowCounter, 19, appliedFilterOptionsItemPointer);
+            sublistTableWidgetPointer->setItem(rowCounter, 20, originalFilterOptionsItemPointer);
+            sublistTableWidgetPointer->setItem(rowCounter, 21, originalEntryItemPointer);
 
             // Increment the row counter.
             ++rowCounter;
index 002393da1cb521d1ef83d1c6c697efea07e3af2f..f04b9bb7e84155de79e1a443ff5ee6fd6b107901 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef FILTER_LISTS_DIALOG_H
index 650ce99f5547164dd02d2aa58c2da409cdb09009..60fba8cd040ed0dc7dbe543ef1c4da1e1f8773b3 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024 Soren Stoutner <soren@stoutner.com>
  *
- * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ * 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
index 201067d42caf714be80a4eff5a42aa248b0837b7..ac7f17620587fbc8c17f8c32420379ab129905db 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024 Soren Stoutner <soren@stoutner.com>
  *
- * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ * 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef HTTPAUTHENTICATIONDIALOG_H
index 1141eae22a3bb5dbc8a75a2bcc98bf16bec3e0da..2b723863271aa09e15dd82d21aa6c833cc2d829d 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
@@ -73,6 +73,7 @@ RequestDetailDialog::RequestDetailDialog(QWidget *parentWidgetPointer, QTableWid
     scriptLineEditPointer = requestDetailDialogUi.scriptLineEdit;
     styleSheetLineEditPointer = requestDetailDialogUi.styleSheetLineEdit;
     subFrameLineEditPointer = requestDetailDialogUi.subFrameLineEdit;
+    webSocketLineEditPointer = requestDetailDialogUi.webSocketLineEdit;
     xmlHttpRequestLineEditPointer = requestDetailDialogUi.xmlHttpRequestLineEdit;
     appliedFilterOptionsLineEditPointer = requestDetailDialogUi.appliedFilterOptionsLineEdit;
     originalFilterOptionsLineEditPointer = requestDetailDialogUi.originalFilterOptionsLineEdit;
@@ -143,7 +144,7 @@ void RequestDetailDialog::populateDialog(const int row)
     // Create a new request struct.
     RequestStruct *requestStructPointer = new RequestStruct();
 
-    // Populate the new request struct.
+    // Populate the new request struct.  The order needs to match how the data stream is populated in RequestsDialog.cpp.
     requestStructDataStreamReader >> requestStructPointer->dispositionInt;
     requestStructDataStreamReader >> requestStructPointer->entryStruct.originalEntry;
     requestStructDataStreamReader >> requestStructPointer->entryStruct.originalFilterOptions;
@@ -165,6 +166,7 @@ void RequestDetailDialog::populateDialog(const int row)
     requestStructDataStreamReader >> requestStructPointer->entryStruct.styleSheet;
     requestStructDataStreamReader >> requestStructPointer->entryStruct.subFrame;
     requestStructDataStreamReader >> requestStructPointer->entryStruct.thirdParty;
+    requestStructDataStreamReader >> requestStructPointer->entryStruct.webSocket;
     requestStructDataStreamReader >> requestStructPointer->entryStruct.xmlHttpRequest;
     requestStructDataStreamReader >> requestStructPointer->filterListTitle;
     requestStructDataStreamReader >> requestStructPointer->isThirdPartyRequest;
@@ -212,6 +214,7 @@ void RequestDetailDialog::populateDialog(const int row)
     scriptLineEditPointer->setText(globalFilterListHelperPointer->getRequestOptionDispositionString(requestStructPointer->entryStruct.script));
     styleSheetLineEditPointer->setText(globalFilterListHelperPointer->getRequestOptionDispositionString(requestStructPointer->entryStruct.styleSheet));
     subFrameLineEditPointer->setText(globalFilterListHelperPointer->getRequestOptionDispositionString(requestStructPointer->entryStruct.subFrame));
+    webSocketLineEditPointer->setText(globalFilterListHelperPointer->getRequestOptionDispositionString(requestStructPointer->entryStruct.webSocket));
     xmlHttpRequestLineEditPointer->setText(globalFilterListHelperPointer->getRequestOptionDispositionString(requestStructPointer->entryStruct.xmlHttpRequest));
     appliedFilterOptionsLineEditPointer->setText(requestStructPointer->entryStruct.appliedFilterOptionsList.join(QLatin1String(" , ")));
     originalFilterOptionsLineEditPointer->setText(requestStructPointer->entryStruct.originalFilterOptions);
@@ -243,6 +246,7 @@ void RequestDetailDialog::populateDialog(const int row)
     setFilterOptionBackgroundPalette(scriptLineEditPointer);
     setFilterOptionBackgroundPalette(styleSheetLineEditPointer);
     setFilterOptionBackgroundPalette(subFrameLineEditPointer);
+    setFilterOptionBackgroundPalette(webSocketLineEditPointer);
     setFilterOptionBackgroundPalette(xmlHttpRequestLineEditPointer);
 
     // Set the request option status.
@@ -256,6 +260,7 @@ void RequestDetailDialog::populateDialog(const int row)
     scriptLineEditPointer->setEnabled(hasRequestOptions);
     styleSheetLineEditPointer->setEnabled(hasRequestOptions);
     subFrameLineEditPointer->setEnabled(hasRequestOptions);
+    webSocketLineEditPointer->setEnabled(hasRequestOptions);
     xmlHttpRequestLineEditPointer->setEnabled(hasRequestOptions);
 
     // Set the domain list line edit to have the same palette as the domain line edit.
@@ -334,6 +339,7 @@ void RequestDetailDialog::populateDialog(const int row)
             case QWebEngineUrlRequestInfo::ResourceTypeServiceWorker:
             case QWebEngineUrlRequestInfo::ResourceTypeCspReport:
             case QWebEngineUrlRequestInfo::ResourceTypePluginResource:
+            case QWebEngineUrlRequestInfo::ResourceTypeJson:
             case QWebEngineUrlRequestInfo::ResourceTypeUnknown:
             {
                 resourceTypeLineEditPointer->setPalette(otherLineEditPointer->palette());
@@ -369,6 +375,13 @@ void RequestDetailDialog::populateDialog(const int row)
                 break;
             }
 
+            // Web Socket.
+            case QWebEngineUrlRequestInfo::ResourceTypeWebSocket:
+            {
+                resourceTypeLineEditPointer->setPalette(webSocketLineEditPointer->palette());
+                break;
+            }
+
             // XML HTTP Request.
             case QWebEngineUrlRequestInfo::ResourceTypeXhr:
             {
index 5dce10ca47872c96ac01c4d75d27b81a6e918dd5..06e9d0c033cf3834ed242be80a0d5474d063e85a 100644 (file)
@@ -1,20 +1,20 @@
- /*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef REQUEST_DETAIL_DIALOG_H
@@ -86,6 +86,7 @@ private:
     QLineEdit *thirdPartyFilterLineEditPointer;
     QLineEdit *thirdPartyRequestLineEditPointer;
     QLineEdit *webPageUrlLineEditPointer;
+    QLineEdit *webSocketLineEditPointer;
     QLineEdit *xmlHttpRequestLineEditPointer;
 
     // The private functions.
index bfb099e1cdb733e87ddfcafee8e2ee393c817612..452b898a6e4caafdd815d0543362391f448fd522 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
@@ -95,7 +95,7 @@ RequestsDialog::RequestsDialog(QWidget *parentWidgetPointer, QList<RequestStruct
         // Create a request struct data stream.
         QDataStream requestStructDataStream(requestStructByteArrayPointer, QIODevice::WriteOnly);
 
-        // Populate the request struct data stream.
+        // Populate the request struct data stream.  The order needs to match what is populated from the data stream in RequestDetailDialog.cpp.
         requestStructDataStream << requestStructPointer->dispositionInt;
         requestStructDataStream << requestStructPointer->entryStruct.originalEntry;
         requestStructDataStream << requestStructPointer->entryStruct.originalFilterOptions;
@@ -117,6 +117,7 @@ RequestsDialog::RequestsDialog(QWidget *parentWidgetPointer, QList<RequestStruct
         requestStructDataStream << requestStructPointer->entryStruct.styleSheet;
         requestStructDataStream << requestStructPointer->entryStruct.subFrame;
         requestStructDataStream << requestStructPointer->entryStruct.thirdParty;
+        requestStructDataStream << requestStructPointer->entryStruct.webSocket;
         requestStructDataStream << requestStructPointer->entryStruct.xmlHttpRequest;
         requestStructDataStream << requestStructPointer->filterListTitle;
         requestStructDataStream << requestStructPointer->isThirdPartyRequest;
index dfa30062f2bd0b03d038da00cc70a3a390c013c4..5a5bd4faf6a9a2c0520f81edf35719292c0eca92 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef REQUESTSDIALOG_H
index 0b8d2d70297607cfc0599beb9c1ab8caedc7a9d3..6433be66e1e892d3844eb4513b8cdf7a71bce8d8 100644 (file)
@@ -1,19 +1,20 @@
-# Copyright 2022-2024 Soren Stoutner <soren@stoutner.com>.
+# SPDX-License-Identifier: GPL-3.0-or-later
+# SPDX-FileCopyrightText: 2022-2024 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.
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
 #
-# 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.
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
 #
-# You should have received a copy of the GNU General Public License
-# along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
 # List the sources to include in the executable.
index 4b1dcbdb1c53ce287a7d7c3d83fcb3738226b599..9d8d2e25831a77d3f2b1eca72b52325ead26a48f 100644 (file)
@@ -52,7 +52,8 @@ FilterListHelper::FilterListHelper()
     NAVIGATION_TYPE_REDIRECT = i18nc("Navigation type redirect", "Redirect");
     NAVIGATION_TYPE_OTHER = i18nc("Navigation type other", "Other");
 
-    // Populate the translated resource type strings.  Translated entries cannot be public static const.
+    // Populate the translated resource type strings (in order of their values <https://doc.qt.io/qt-6/qwebengineurlrequestinfo.html#ResourceType-enum>).
+    // Translated entries cannot be public static const.
     RESOURCE_TYPE_MAIN_FRAME = i18nc("Resource type main frame", "Main Frame");
     RESOURCE_TYPE_SUB_FRAME = i18nc("Resource type sub frame", "Sub Frame");
     RESOURCE_TYPE_STYLESHEET = i18nc("Resource type stylesheet", "Stylesheet");
@@ -73,6 +74,7 @@ FilterListHelper::FilterListHelper()
     RESOURCE_TYPE_PLUGIN_RESOURCE = i18nc("Resource type plugin request", "Plugin Request");
     RESOURCE_TYPE_NAVIGATION_PRELOAD_MAIN_FRAME = i18nc("Resource type preload main frame", "Preload Main Frame");
     RESOURCE_TYPE_NAVIGATION_PRELOAD_SUB_FRAME = i18nc("Resource type preload sub frame", "Preload Sub Frame");
+    RESOURCE_TYPE_WEB_SOCKET = i18nc("Resource type web socket", "Web Socket");
     RESOURCE_TYPE_UNKNOWN = i18nc("Resource type unknown", "Unknown");
 
     // Populate the translated sublist strings.  Translated entries cannot be public static const.
@@ -706,6 +708,10 @@ bool FilterListHelper::checkRequestOptions(QWebEngineUrlRequestInfo &urlRequestI
                                                                              (requestStructPointer->resourceTypeInt == QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadSubFrame)))
         return processRequest(urlRequestInfo, requestStructPointer, filterListTitle, sublistInt, entryStructPointer);
 
+    // Process web socket requests.
+    if ((entryStructPointer->webSocket == FilterOptionDisposition::Apply) && (requestStructPointer->resourceTypeInt == QWebEngineUrlRequestInfo::ResourceTypeWebSocket))
+        return processRequest(urlRequestInfo, requestStructPointer, filterListTitle, sublistInt, entryStructPointer);
+
     // Process XML HTTP requests.
     if ((entryStructPointer->xmlHttpRequest == FilterOptionDisposition::Apply) && (requestStructPointer->resourceTypeInt == QWebEngineUrlRequestInfo::ResourceTypeXhr))
         return processRequest(urlRequestInfo, requestStructPointer, filterListTitle, sublistInt, entryStructPointer);
@@ -778,7 +784,7 @@ QString FilterListHelper::getRequestOptionDispositionString(const FilterOptionDi
 
 QString FilterListHelper::getResourceTypeString(int resourceTypeInt) const
 {
-    // Return the translated resource type string.
+    // Return the translated resource type string (in order of their values <https://doc.qt.io/qt-6/qwebengineurlrequestinfo.html#ResourceType-enum>).
     switch (resourceTypeInt)
     {
         case QWebEngineUrlRequestInfo::ResourceTypeMainFrame: return RESOURCE_TYPE_MAIN_FRAME;
@@ -801,6 +807,7 @@ QString FilterListHelper::getResourceTypeString(int resourceTypeInt) const
         case QWebEngineUrlRequestInfo::ResourceTypePluginResource: return RESOURCE_TYPE_PLUGIN_RESOURCE;
         case QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadMainFrame: return RESOURCE_TYPE_NAVIGATION_PRELOAD_MAIN_FRAME;
         case QWebEngineUrlRequestInfo::ResourceTypeNavigationPreloadSubFrame: return RESOURCE_TYPE_NAVIGATION_PRELOAD_SUB_FRAME;
+        case QWebEngineUrlRequestInfo::ResourceTypeWebSocket: return RESOURCE_TYPE_WEB_SOCKET;
         default: return RESOURCE_TYPE_UNKNOWN;
     }
 }
@@ -1027,8 +1034,8 @@ FilterListStruct* FilterListHelper::populateFilterList(const QString &filterList
                         // Set the has request options flag.
                         entryStructPointer->hasRequestOptions = true;
                     }
-                    else if ((filterOption == QLatin1String("other")) || (filterOption == QLatin1String("webrtc")) || (filterOption == QLatin1String("websocket")))  // Other.
-                    {  // `websocket` will get its own section in Qt6.
+                    else if ((filterOption == QLatin1String("other")) || (filterOption == QLatin1String("webrtc")))  // Other.
+                    {
                         // Populate the other disposition.
                         entryStructPointer->other = FilterOptionDisposition::Apply;
 
@@ -1067,6 +1074,14 @@ FilterListStruct* FilterListHelper::populateFilterList(const QString &filterList
                         // Set the has request options flag.
                         entryStructPointer->hasRequestOptions = true;
                     }
+                    else if (filterOption == QLatin1String("websocket"))  // Web socket.
+                    {
+                        // Populate the web socket disposition.
+                        entryStructPointer->webSocket = FilterOptionDisposition::Apply;
+
+                        // Set the has request options flag.
+                        entryStructPointer->hasRequestOptions = true;
+                    }
                     else if (filterOption == QLatin1String("xmlhttprequest"))  // XML HTTP request.
                     {
                         //Populate the XML HTTP request disposition.
@@ -1105,8 +1120,8 @@ FilterListStruct* FilterListHelper::populateFilterList(const QString &filterList
                         overrideStruct.hasOverride = true;
                         overrideStruct.object = true;
                     }
-                    else if ((filterOption == QLatin1String("~other")) || (filterOption == QLatin1String("~webrtc")) || (filterOption == QLatin1String("~websocket")))  // Other override.
-                    {  // `websocket` will get its own section in Qt6.
+                    else if ((filterOption == QLatin1String("~other")) || (filterOption == QLatin1String("~webrtc")))  // Other override.
+                    {
                         // Populate the override struct.
                         overrideStruct.hasOverride = true;
                         overrideStruct.other = true;
@@ -1135,6 +1150,12 @@ FilterListStruct* FilterListHelper::populateFilterList(const QString &filterList
                         overrideStruct.hasOverride = true;
                         overrideStruct.subFrame = true;
                     }
+                    else if (filterOption == QLatin1String("~websocket"))  // Web socket override.
+                    {
+                        // Populate the override struct.
+                        overrideStruct.hasOverride = true;
+                        overrideStruct.webSocket = true;
+                    }
                     else if (filterOption == QLatin1String("~xmlhttprequest"))  // XML HTTP request override.
                     {
                         // Populate the override struct.
@@ -1209,6 +1230,12 @@ FilterListStruct* FilterListHelper::populateFilterList(const QString &filterList
                     else
                         entryStructPointer->subFrame = FilterOptionDisposition::Apply;
 
+                    // Web Socket.
+                    if (overrideStruct.webSocket)
+                        entryStructPointer->webSocket = FilterOptionDisposition::Override;
+                    else
+                        entryStructPointer->webSocket = FilterOptionDisposition::Apply;
+
                     // XML HTTP Request.
                     if (overrideStruct.xmlHttpRequest)
                         entryStructPointer->xmlHttpRequest = FilterOptionDisposition::Override;
index 93cf4c3565748ec3e0ec1ba4e8586c16a13571dd..7241dea362dc49b93575070e1496e4507579ccd5 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: GPL-3.0-or-later
- * SPDX-FileCopyrightText: 2024 Soren Stoutner <soren@stoutner.com>
+ * SPDX-FileCopyrightText: 2024-2025 Soren Stoutner <soren@stoutner.com>
  *
  * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc/>.
  *
@@ -83,7 +83,7 @@ private:
     QString NAVIGATION_TYPE_REDIRECT;
     QString NAVIGATION_TYPE_OTHER;
 
-    // The private translated resource type strings.
+    // The private translated resource type strings (in order of their values <https://doc.qt.io/qt-6/qwebengineurlrequestinfo.html#ResourceType-enum>).
     QString RESOURCE_TYPE_MAIN_FRAME;
     QString RESOURCE_TYPE_SUB_FRAME;
     QString RESOURCE_TYPE_STYLESHEET;
@@ -104,6 +104,7 @@ private:
     QString RESOURCE_TYPE_PLUGIN_RESOURCE;
     QString RESOURCE_TYPE_NAVIGATION_PRELOAD_MAIN_FRAME;
     QString RESOURCE_TYPE_NAVIGATION_PRELOAD_SUB_FRAME;
+    QString RESOURCE_TYPE_WEB_SOCKET;
     QString RESOURCE_TYPE_UNKNOWN;
 
     // The private translated sublist strings.
index 01e1b229a69f425fd2d1057be61941cfbee1c239..8ae17feff8e51e65cbfd44a1b12347a5d8b79114 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2023-2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2023-2024 Soren Stoutner <soren@stoutner.com>
  *
- * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ * 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 // Application headers.
index 9248576c2920e86b7403a20ef0a2ec295e71c7c7..0966d9e64ae51880b3eef492a89fb1495ff93c57 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2023 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2023 Soren Stoutner <soren@stoutner.com>
  *
- * This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc>.
+ * 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef FOLDERHELPER_H
index cc258403b19e3b0914d0539e35c4a5a8ed76938d..49e1c4cd01aa21078fe85753e3cbc9e609440692 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2023 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2023 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef BOOKMARKSTRUCT_H
index 6b0fed550804c969c0e9f741cc035770d4352d57..d73039201e73c0f78035312202ed52ea481fdf3c 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef ENTRY_STRUCT_H
@@ -63,6 +63,7 @@ struct EntryStruct
     FilterOptionDisposition styleSheet = FilterOptionDisposition::Null;
     FilterOptionDisposition subFrame = FilterOptionDisposition::Null;
     FilterOptionDisposition thirdParty = FilterOptionDisposition::Null;
+    FilterOptionDisposition webSocket = FilterOptionDisposition::Null;
     FilterOptionDisposition xmlHttpRequest = FilterOptionDisposition::Null;
 };
 #endif
index 72a9453f517c9750e28ac0127e3ee359769920ab..c732f56ec0d9863984a5f2266804f188c0a2caee 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef FILTER_LIST_STRUCT_H
index 0568a79636bcfe57e4bf3eeddeb461d929f2078a..25cb96de79c6b6b989a8fb5d3bb739e03af7d503 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024-2025 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef OVERRIDESTRUCT_H
@@ -33,6 +33,7 @@ struct OverrideStruct
     bool script = false;
     bool styleSheet = false;
     bool subFrame = false;
+    bool webSocket = false;
     bool xmlHttpRequest = false;
 };
 #endif
index 399948c7c233f39f997f21da8d7b4a1db4319216..85a6eab6ce306409c29717fc3c9c29c6fdf869cf 100644 (file)
@@ -1,20 +1,20 @@
-/*
- * Copyright 2024 Soren Stoutner <soren@stoutner.com>.
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * SPDX-FileCopyrightText: 2024 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.
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
  *
- * 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.
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ * details.
  *
- * You should have received a copy of the GNU General Public License
- * along with Privacy Browser PC.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #ifndef REQUEST_STRUCT_H
index c87da3c701467c5e1ab39e85da3acba588dce884..e900697777006b55170bf0379c23f47c69e02ee9 100644 (file)
@@ -2,7 +2,7 @@
 
 <!--
   SPDX-License-Identifier: GPL-3.0-or-later
-  SPDX-FileCopyrightText: 2024 Soren Stoutner <soren@stoutner.com>
+  SPDX-FileCopyrightText: 2024-2025 Soren Stoutner <soren@stoutner.com>
 
   This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc/>.
 
                                     </widget>
                                 </item>
 
-                                <!-- XML HTTP Request. -->
+                                <!-- Web Socket. -->
                                 <item row="2" column="4">
                                     <widget class="QLabel">
                                         <property name="text">
-                                            <string>XML HTTP Request</string>
+                                            <string>Web Socket</string>
                                         </property>
 
                                         <property name="alignment">
                                 </item>
 
                                 <item row="2" column="5">
+                                    <widget class="QLineEdit" name="webSocketLineEdit">
+                                        <property name="readOnly">
+                                            <bool>true</bool>
+                                        </property>
+
+                                        <!-- Disabling focus allows the arrow keys to activate the buttons. -->
+                                        <property name="focusPolicy">
+                                            <enum>Qt::NoFocus</enum>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <!-- XML HTTP Request. -->
+                                <item row="2" column="6">
+                                    <widget class="QLabel">
+                                        <property name="text">
+                                            <string>XML HTTP Request</string>
+                                        </property>
+
+                                        <property name="alignment">
+                                            <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                                        </property>
+                                    </widget>
+                                </item>
+
+                                <item row="2" column="7">
                                     <widget class="QLineEdit" name="xmlHttpRequestLineEdit">
                                         <property name="readOnly">
                                             <bool>true</bool>
index 53d74f42ffcc4362637c18c0a7435a3a5d9296e2..04712e69b9b0607c7e7440e88a26b7e015d69074 100644 (file)
@@ -2,7 +2,7 @@
 
 <!--
   SPDX-License-Identifier: GPL-3.0-or-later
-  SPDX-FileCopyrightText: 2024 Soren Stoutner <soren@stoutner.com>
+  SPDX-FileCopyrightText: 2024-2025 Soren Stoutner <soren@stoutner.com>
 
   This file is part of Privacy Browser PC <https://www.stoutner.com/privacy-browser-pc/>.
 
                                                                 </widget>
                                                             </item>
 
-                                                            <!-- XML HTTP Request. -->
+                                                            <!-- Web Socket. -->
                                                             <item row="2" column="4">
                                                                 <widget class="QLabel">
                                                                     <property name="text">
-                                                                        <string>XML HTTP Request</string>
+                                                                        <string>Web Socket</string>
                                                                     </property>
 
                                                                     <property name="alignment">
                                                             </item>
 
                                                             <item row="2" column="5">
+                                                                <widget class="QLineEdit" name="webSocketLineEdit">
+                                                                    <property name="readOnly">
+                                                                        <bool>true</bool>
+                                                                    </property>
+
+                                                                    <!-- Disabling focus allows the arrow keys to activate the buttons. -->
+                                                                    <property name="focusPolicy">
+                                                                        <enum>Qt::NoFocus</enum>
+                                                                    </property>
+                                                                </widget>
+                                                            </item>
+
+                                                            <!-- XML HTTP Request. -->
+                                                            <item row="2" column="6">
+                                                                <widget class="QLabel">
+                                                                    <property name="text">
+                                                                        <string>XML HTTP Request</string>
+                                                                    </property>
+
+                                                                    <property name="alignment">
+                                                                        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+                                                                    </property>
+                                                                </widget>
+                                                            </item>
+
+                                                            <item row="2" column="7">
                                                                 <widget class="QLineEdit" name="xmlHttpRequestLineEdit">
                                                                     <property name="readOnly">
                                                                         <bool>true</bool>