Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user option for disabling notifications when using private browsing #1161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zilldevel
Copy link

@zilldevel zilldevel commented Apr 13, 2024

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:

Error: Error: not found any normal not private/incognito/popup windows.

Addon stopped working. Please, restart browser.

Screenshots:

Target Notification:

stg-private-browsing-notification

What this change adds:

stg-new-option

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 under addon/src/_locales/*/messages.json files.

Builds / testing

I am on Fedora Linux and built the project using the following:

$ cd addons
$ npm install && npm run build && npm run build-zip

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.

…e translations) to allow disabling notification spam when in private browsing
@zilldevel zilldevel changed the title App user option for disabling notifications when using private browsing Add user option for disabling notifications when using private browsing Apr 13, 2024
@julio25-Linux
Copy link

Will you ever release this extension for other browsers?

@zilldevel
Copy link
Author

Will you ever release this extension for other browsers?

I am not the author of STG and this appears to be completely off-topic / unrelated to my changes. So I'm a bit confused why you are commenting here.

Unless you are stating that the addon currently works in other browsers and you have built and tested my change (which has not even been accepted yet), then I think you likely commented in the entirely wrong place. This should be a new "issue" (asking a question is often done as a new issue in other projects) rather than as a completely off-topic comment in a pull request.

As I said, I am not the author of STG so I don't know for certain but it could be that there are differences in the tabs api between firefox and chromium preventing a straight-up port. I haven't studied the firefox and chromium tab api docs in enough depth to make any guesses. I can confirm that STG works in other Firefox-based browsers like LibreWolf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants