commit 7d7b9f5e2041d618b7bb90a205ee3701cd3cfa67 Author: f.strw Date: Sun Mar 24 22:43:05 2024 +0300 Release diff --git a/README.md b/README.md new file mode 100644 index 0000000..a92c4d1 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +
+

Google Images filter script

+
+ +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? + +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. \ No newline at end of file diff --git a/meta/s1.png b/meta/s1.png new file mode 100644 index 0000000..b23da80 Binary files /dev/null and b/meta/s1.png differ diff --git a/script.js b/script.js new file mode 100644 index 0000000..d20033a --- /dev/null +++ b/script.js @@ -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(); + } + } + } + } + } +})(); \ No newline at end of file