This commit is contained in:
f.strw 2024-03-24 22:43:05 +03:00
commit 7d7b9f5e20
No known key found for this signature in database
GPG key ID: 2578C80321DFC48A
3 changed files with 45 additions and 0 deletions

18
README.md Normal file
View file

@ -0,0 +1,18 @@
<div style="text-align: center">
<h1>Google Images filter script</h1>
</div>
Compatible with Tampermonkey, should work with other userscript extensions, but really just use Tampermonkey.
## The problem
Have you ever searched for some image on Google Images (especially if it's some meme or logo) and stumbled upon these ugly """"product"""" images?
<img src="https://fem.mint.lgbt/f.strw/google-images-filter/raw/branch/master/meta/s1.png">
While on this screenshot there's not much of them, sometimes your **image** search turns into a fucking **marketplace**, and that's not what you would expect from **image** searching.
I mean come on, just how many stuff you **bought** of a Google **image** search?
## The solution
I wrote a little script that removes **marketplace** items from your **image** searching results. Just click `Install` link below to add the script to your userscript extension.
### [Install](https://fem.mint.lgbt/f.strw/google-images-filter/raw/branch/master/script.js)
Feel free to add more or remove domains to match your preferences.

BIN
meta/s1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

27
script.js Normal file
View file

@ -0,0 +1,27 @@
// ==UserScript==
// @name Google Images filter
// @namespace https://fem.mint.lgbt/f.strw
// @version v1
// @description Removes shopping from a place where you look for a fucking pictures.
// @author f.strw
// @include *
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (window.location.search.indexOf('&tbm=isch') > -1) {
var blockedDomains = ["redbubble.com", "etsy.com", "amazon.com", "amazon.de", "aliexpress.com", "teepublic.com", "badgeland.com", "ebay.com"];
var links = document.getElementsByTagName("a");
for (var i = 0; i < links.length; i++) {
for (var j = 0; j < blockedDomains.length; j++) {
if (links[i].href.indexOf(blockedDomains[j]) !== -1) {
var parentDiv = links[i].closest("div");
if (parentDiv) {
parentDiv.remove();
}
}
}
}
}
})();