thibaud-rohmer / PhotoShow

A free web gallery in PHP with drag-n-drop support
http://www.photoshow-gallery.com
502 stars 151 forks source link

Exclusion filter #382

Open vertigo220 opened 1 year ago

vertigo220 commented 1 year ago

While PhotoShow can be disabled for individual websites, that may not be ideal, yet there are often certain elements on sites that the user may want to exclude. For example, on google, I want to be able to enlarge/save images in search results, but I often have the cursor over something (usually the word "Google" in the top-left) when typing into the search, and every time I type an "s" or "c" it downloads it or copies the link. And on forums, I want to have it work on images in posts, but not on react/like buttons.

It would be great to have a filter added to block it from acting on these types of things. It probably wouldn't be able to do it automatically, since the URLs for these things tends to vary a lot, but there are certain portions of the URLs that are typically the same and could be used, as well as the alt-text and possibly resolutions. For example, to exclude the "Google" text, a filter could be set for a URL that contains "https:// www .google.com/webhp?" with alt-text "Go to Google Home" and size 184x60. For forum reaction buttons, it could be set for a URL that contains "https:// forumname.com/*reaction=" with alt-text "Like|Agree|etc" and size XXXxYYY. This would be a bit harder to do than having it automated, but not overly difficult, and it would likely work much better than trying to automate it. And, of course, for more basic users, they wouldn't have to use it, so it wouldn't add more complication to the base functionality, though there could perhaps be a user-contributed database here (and possibly built into the extension) where they could search for filters for a given website and add them so they don't have to create them on their own.