Update for "ban image" functionality (#1516)#1517
Conversation
GrosPoulet
commented
Jan 5, 2025
- when an image (or video & audio track) is banned:
- url of banned image is stored in background page local storage
- a message is sent to all tabs with updated list of banned urls
- removal of async call to background page: check for banned image is now performed synchronously in each tab
- when an image (or video & audio track) is banned: - url of banned image is stored in background page local storage - a message is sent to all tabs with updated list of banned urls - removal of async call to background page: check for banned image is now performed synchronously in each tab
|
|
@extesy looks like i have lost the ability to merge my PR ??? |
|
Yes, I wanted to have opportunity to review the code before it's merged instead of doing post-merge fixes. |
|
@GrosPoulet If you still want this PR to be merged, please resolve conflicts. I'm going to be making more changes for Manifest V3 compatibility, so if it's not merged soon then it will be progressively harder to resolve conflicts. |
| function isImageBanned(url) { | ||
| if (!url) return false; | ||
| reutrn !!bannedImagesList[url]; | ||
| } |
There was a problem hiding this comment.
@GrosPoulet Is bannedImagesList an array (list) or a set? According to https://stackoverflow.com/questions/2430000/determine-if-string-is-in-list-in-javascript if it's a list then you should use .include to check membership, and if it's a set then you should use .has.
There was a problem hiding this comment.
@extesy bannedImagesList is a set (key:value), urls are used as keys
There was a problem hiding this comment.
key:value is a dictionary (aka a map), not a set. Are values used for anything?
There was a problem hiding this comment.
value = location (page url) where banned image was found
|


