From 1f7ac15b8de6d6321c6ee84b0178ef6dc8aa22da Mon Sep 17 00:00:00 2001 From: Soren Stoutner Date: Wed, 29 Jan 2025 15:48:43 -0700 Subject: [PATCH] Fix loading of websites when the user agent changes. https://redmine.stoutner.com/issues/821 --- COPYING | 10 +- doc/index.docbook | 25 ++--- src/CMakeLists.txt | 6 +- ... com.stoutner.privacybrowser.metainfo.xml} | 0 src/dialogs/DomainSettingsDialog.cpp | 15 ++- src/icons/javascript-warning.svg | 2 +- src/icons/privacy-mode.svg | 2 +- src/icons/privacybrowser-symbolic.svg | 2 +- src/icons/sc-apps-privacybrowser.svg | 2 +- src/interceptors/UrlRequestInterceptor.cpp | 40 +++++-- src/interceptors/UrlRequestInterceptor.h | 4 +- src/main.cpp | 4 +- src/widgets/PrivacyWebEngineView.cpp | 105 ++++++++++++++---- src/widgets/PrivacyWebEngineView.h | 8 +- src/widgets/TabWidget.cpp | 6 +- 15 files changed, 160 insertions(+), 71 deletions(-) rename src/{com.stoutner.privacybrowser.appdata.xml => com.stoutner.privacybrowser.metainfo.xml} (100%) diff --git a/COPYING b/COPYING index bc16d08..ab6ac2b 100644 --- a/COPYING +++ b/COPYING @@ -1,5 +1,5 @@ SPDX-License-Identifier: GPL-3.0-or-later -SPDX-FileCopyrightText: 2016-2017, 2021-2024 Soren Stoutner +SPDX-FileCopyrightText: 2016-2017, 2021-2025 Soren Stoutner This file is part of Privacy Browser PC . @@ -17,7 +17,7 @@ details. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -661,7 +661,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -680,11 +680,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. diff --git a/doc/index.docbook b/doc/index.docbook index 3bd7754..f685525 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -1,23 +1,18 @@ + You should have received a copy of the GNU Free Documentation License + along with this program. If not, see . --> @@ -42,7 +37,7 @@ - 2016-2017, 2021-2024 + 2016-2017, 2021-2025 &Soren.Stoutner; @@ -2018,7 +2013,7 @@ Credits and License - Privacy Browser PC copyright 2016-2017, 2021-2024 Soren Stoutner soren@stoutner.com. + Privacy Browser PC copyright 2016-2017, 2021-2025 Soren Stoutner soren@stoutner.com. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5e0a2f..799c44e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-3.0-or-later -# SPDX-FileCopyrightText: 2022-2024 Soren Stoutner +# SPDX-FileCopyrightText: 2022-2025 Soren Stoutner # # This file is part of Privacy Browser PC . # @@ -97,8 +97,8 @@ install(TARGETS privacybrowser ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) # Install Privacy Browser according to the instructions in the desktop file, specifying the permissions. install(PROGRAMS com.stoutner.privacybrowser.desktop DESTINATION ${KDE_INSTALL_APPDIR} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) -# Install the metadata file. -install(FILES com.stoutner.privacybrowser.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) +# Install the metainfo file. +install(FILES com.stoutner.privacybrowser.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR}) # Install the notifyrc file. install(FILES privacybrowser.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR}) diff --git a/src/com.stoutner.privacybrowser.appdata.xml b/src/com.stoutner.privacybrowser.metainfo.xml similarity index 100% rename from src/com.stoutner.privacybrowser.appdata.xml rename to src/com.stoutner.privacybrowser.metainfo.xml diff --git a/src/dialogs/DomainSettingsDialog.cpp b/src/dialogs/DomainSettingsDialog.cpp index 8c77d6d..96ea20f 100644 --- a/src/dialogs/DomainSettingsDialog.cpp +++ b/src/dialogs/DomainSettingsDialog.cpp @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: GPL-3.0-or-later - * SPDX-FileCopyrightText: 2022-2024 Soren Stoutner + * SPDX-FileCopyrightText: 2022-2025 Soren Stoutner * * This file is part of Privacy Browser PC . * @@ -300,6 +300,19 @@ void DomainSettingsDialog::domainSelected(const QModelIndex &modelIndex) const // Populate the zoom factor combo box. zoomFactorComboBoxPointer->setCurrentIndex(zoomFactorComboBoxIndex); + // Get the combo box palette. + QPalette comboBoxPalette = zoomFactorComboBoxPointer->palette(); + + // Get the combo box window color. + QColor comboBoxWindowColor = comboBoxPalette.color(QPalette::Window); + + // Set the combo box window color back to the palette. This makes the system think the palette has changed. + comboBoxPalette.setColor(QPalette::Window, comboBoxWindowColor); + + // Explicitly set the combo box palette. Because the system thinks the palette has been changed, and because the combo box palette is being explicitly set, + // the system will not propagate the highlighted palette from the widget pointer palette down to the combo box. + zoomFactorComboBoxPointer->setPalette(comboBoxPalette); + // Populate the custom zoom factor spin box according to the zoom factor combo box. if (zoomFactorComboBoxIndex == 0) // System default zoom factor is selected. { diff --git a/src/icons/javascript-warning.svg b/src/icons/javascript-warning.svg index c9e4542..4da7a56 100644 --- a/src/icons/javascript-warning.svg +++ b/src/icons/javascript-warning.svg @@ -1,7 +1,7 @@