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

New addon: Hide avdertising comments #7248

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

Jazza-231
Copy link
Contributor

@Jazza-231 Jazza-231 commented Mar 4, 2024

Resolves community suggestion

Changes

Adds a new addon that hides comments that contain certain strings deemed as advertising by the user. Presets are supplied.

Reason for changes

Advertising is so so prevelant on scratch, and it is really annoying to see. Since reporting on the user's behalf is not a good idea, hiding them is the next best idea.

Tests

Wroks on the latest version of brave.

ToDo

Add the option to replace the offending text with something like [Marked as advertising], with the option to show it when clicked on.
Change logic for what to hide, only hide the whole thread of messages if the top is advertising, not if advertising is present in any of the thread
Fix the problem outlined here HELP!!!

@Jazza-231
Copy link
Contributor Author

Jazza-231 commented Mar 4, 2024

Odd thing, on the profile, for some reason it can not hide more than one comment like this:
image
but it can hide more than one reply, like this:
image

This doesnt happen at all on project pages (or studios) (and obviously i set "elephant" to be classified as advertising)

@DNin01
Copy link
Member

DNin01 commented Mar 4, 2024

Should probably be discussed at least a little bit. Completely hiding comments means you can't report them, so this could potentially backfire on the community.

@Samq64
Copy link
Member

Samq64 commented Mar 4, 2024

@Jazza-231
Copy link
Contributor Author

Should probably be discussed at least a little bit. Completely hiding comments means you can't report them, so this could potentially backfire on the community.

If you check the todo, i have adresses this: Add the option to replace the offending text with something like [Marked as advertising], with the option to show it when clicked on.

@Jazza-231
Copy link
Contributor Author

          if (addon.settings.get("method") === "censor" && !url.includes(settings["profiles"])) {
            const commentReply = await addon.tab.waitForElement("div.replies>div.comment", { markAsSeen: true });
            console.log("Checing replies");
            matches.forEach((match) => {
              if (dsis(commentReply, match)) {
                handleComment(commentReply);
              }
            });
          }

This code seems to be causing problems, im not entirely sure why but when this is not commented out, it can only manage to mark a few comments as advertising before it breaks? im not too sure why. People tend to advertise in replies a lot less than normal comments, so this isnt too big of an issue, but if anyone knows whats going on that would be great

@Jazza-231
Copy link
Contributor Author

image
image

This is the new setting for censoring instead of hiding

@Samq64 Samq64 added type: enhancement New feature for the project new addon Related to new addons to this extension. `scope: addons` should still be added. scope: addon Related to one or multiple addons labels Mar 5, 2024
@Jazza-231
Copy link
Contributor Author

Please see this message in the SA dev server

@Jazza-231
Copy link
Contributor Author

image
only issue now is the profiles when you choose censor

addons/hide-ads/addon.json Outdated Show resolved Hide resolved
@Waakul
Copy link
Contributor

Waakul commented Mar 7, 2024

Why did'nt you sync to upstream before creating the branch?, there are conflicts now.

@Jazza-231
Copy link
Contributor Author

Why did'nt you sync to upstream before creating the branch?, there are conflicts now.

I've been meaning to ask about this, i keep my master branch up to date, and i create new branches off the master, but for some reason it doesnt seem to be up to date? im not sure why

@DNin01
Copy link
Member

DNin01 commented Mar 8, 2024

Why did'nt you sync to upstream before creating the branch?, there are conflicts now.

I've been meaning to ask about this, i keep my master branch up to date, and i create new branches off the master, but for some reason it doesnt seem to be up to date? im not sure why

Next time, try pulling from upsteam/master. You'll get the latest changes not just from your fork's master branch but from the source repository.

@Chiroyce1
Copy link
Contributor

I'd say remove the hide option entirely, if this addon is enabled the only thing it should be doing is replace it's content with [Marked as advertising] but without hiding any extra information like the username or timestamp (both of which aren't present in your screenshots) - hiding comments might potentially block false positives or as DNin01 said you wouldn't be able to report or delete them.

@Jazza-231
Copy link
Contributor Author

Jazza-231 commented Mar 8, 2024

I'd say remove the hide option entirely, if this addon is enabled the only thing it should be doing is replace it's content with [Marked as advertising] but without hiding any extra information like the username or timestamp (both of which aren't present in your screenshots) - hiding comments might potentially block false positives or as DNin01 said you wouldn't be able to report or delete them.

It defaults to censoring, I believe they should have the choice to hide them fully, as multiple people have expressed wanting that (and the extra info including message comment is accessible by clicking on the censored comment)

@DNin01
Copy link
Member

DNin01 commented Mar 8, 2024

I believe they should have the choice to hide them fully, as multiple people have expressed wanting that

I think some people will appreciate customization options that reduce visual clutter, but with great power comes great responsibility. It also means that if a comment is flagged incorrectly, you won't be able to see it.

One option would be to somehow warn users that when using this option, these comments will become impossible to report or read.

For signed-out users, I don't see this being a problem, as you have to sign in to report comments.

@Jazza-231
Copy link
Contributor Author

I believe they should have the choice to hide them fully, as multiple people have expressed wanting that

I think some people will appreciate customization options that reduce visual clutter, but with great power comes great responsibility. It also means that if a comment is flagged incorrectly, you won't be able to see it.

One option would be to somehow warn users that when using this option, these comments will become impossible to report or read.

For signed-out users, I don't see this being a problem, as you have to sign in to report comments.

I agree, I'll add a warning for it. (And oh my god signed out users, someone remind me to test it for them...)

I was also thinking some more accurate matching like blocking links on projects only, but that seems it might get a bit too complex visually, I think this is a good alternative. Plus, you can always disable the addon temporarily to see what is hidden, cuz dynamic enable and disable is supported now

addons/hide-ads/userscript.js Outdated Show resolved Hide resolved
addons/hide-ads/userscript.js Outdated Show resolved Hide resolved
addons/hide-ads/userscript.js Outdated Show resolved Hide resolved
}

.contains-advertising {
opacity: 0.5;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this maybe be an issue for vision impaired users?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they have the addon on, they know its supposed to hide potential adevertising. Plus, comments are not very vision impaired friendly anyway. I can of course make that a setting but i really dont think thats needed

addons/hide-ads/userscript.js Show resolved Hide resolved
addons/hide-ads/userscript.js Show resolved Hide resolved
addons/hide-ads/userscript.js Show resolved Hide resolved
Jazza-231 and others added 4 commits March 10, 2024 17:23
Co-authored-by: mybearworld <130385691+mybearworld@users.noreply.github.com>
Co-authored-by: mybearworld <130385691+mybearworld@users.noreply.github.com>
Copy link
Contributor

@Waakul Waakul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l10n means localization (l, then 10 letters, then n)

@Jazza-231
Copy link
Contributor Author

l10n means localization (l, then 10 letters, them n

weird

@Jazza-231
Copy link
Contributor Author

In case you cant tell im just going through my prs, any word on this one?

Copy link
Contributor

@Waakul Waakul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could show a dropdown like "5 messages marked as advertising" like blocked messages in discord.

@Jazza-231
Copy link
Contributor Author

It could show a dropdown like "5 messages marked as advertising" like blocked messages in discord.

I am not doing that. Very difficult, tried before

@Waakul
Copy link
Contributor

Waakul commented Mar 25, 2024

It could show a dropdown like "5 messages marked as advertising" like blocked messages in discord.

I am not doing that. Very difficult, tried before

set display of the marked as advertising messages to none, add a button " marked as advertising". Add a click event to that and create a toggle variable. then below that add an if condition to set display to none or whatever is needed.

@Jazza-231
Copy link
Contributor Author

It could show a dropdown like "5 messages marked as advertising" like blocked messages in discord.

I am not doing that. Very difficult, tried before

set display of the marked as advertising messages to none, add a button " marked as advertising". Add a click event to that and create a toggle variable. then below that add an if condition to set display to none or whatever is needed.

...have you even tested the addon at all? try knowing what you're talking about before correcting someone. the marked as advertising text is a button which shows the comment and replies. I am not adding the count

@Waakul
Copy link
Contributor

Waakul commented Mar 25, 2024

It could show a dropdown like "5 messages marked as advertising" like blocked messages in discord.

I am not doing that. Very difficult, tried before

set display of the marked as advertising messages to none, add a button " marked as advertising". Add a click event to that and create a toggle variable. then below that add an if condition to set display to none or whatever is needed.

...have you even tested the addon at all? try knowing what you're talking about before correcting someone. the marked as advertising text is a button which shows the comment and replies. I am not adding the count

I meant merging it into one single button not wrapped in a comment container, instead showing multiple buttons in comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new addon Related to new addons to this extension. `scope: addons` should still be added. scope: addon Related to one or multiple addons type: enhancement New feature for the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants