Add user option for disabling notifications when using private browsing #1161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Small change to allow users to turn off the notification about private browsing, as it can be annoying when one is working in private browsing mode.
Problem:
Currently, it is very annoying to have STG installed (for normal browsing) and then open Firefox/Librewolf in a private browsing session due to the error notification that is displayed every time the user opens a new window. Certain addons that open dialog windows, such as DownThemAll, also trigger STG's error notification (when used in private browsing mode). So depending on what addons the user has, what they are doing, and how frequently they open new private browsing windows, the user could potentially be seeing this notification MUCH more frequently than simply once per day.
Notification Text:
Screenshots:
Target Notification:
What this change adds:
Code Description:
As the current version of STG does not even allow using the addon in private browsing anyway, it is debatable whether it even makes sense to have this error notification displayed at all. But that is not a decision for me to make and is outside the scope of this PR.
Instead, this PR aims simply to give the user a way to disable that specific error notification by providing a checkbox on the STG options page. The default is unchecked (false) which has the same behavior as STG currently has, simply incase the error is desired / to help users initially realize that STG doesn't work in private session.
If user checks the checkbox (true), then the notification no longer appears. Internally, the addon still throws an exception and handles everything else the same, only the notification is skipped.
Only the logic for the notification mentioned above is modified (other notifications are unaffected, only the handling for this specific one is different).
Since I only know English, the other locale messages are google translations. See the new
"disableWindowNotFoundNotifications"
string underaddon/src/_locales/*/messages.json
files.Builds / testing
I am on Fedora Linux and built the project using the following:
After an initial test build on the master branch to confirm there were no issues with the build on my setup, I switched to my change branch and rebuilt.
I have not looked into the signing process yet and Firefox 124.0.1 would not allow me to install due to the build being unsigned. However, in LibreWolf 124.0.1 (a popular firefox fork), I was able to set
xpinstall.signatures.required=false
and install there. After install, I confirmed that the notification is still present in private browsing (e.g. current behavior) by default / while the checkbox is unchecked, then, after checking the option, that the notification is no longer displayed.