From d4b9d867d86ff7e407f6d167abd1c36495d2e17d Mon Sep 17 00:00:00 2001 From: gdm85 Date: Thu, 7 Apr 2022 13:11:23 +0200 Subject: [PATCH] Replace single-letter logo and remove sign-in link --- app/filter.py | 9 +++++++++ app/utils/results.py | 1 + 2 files changed, 10 insertions(+) diff --git a/app/filter.py b/app/filter.py index 8c3b780..e0e7107 100644 --- a/app/filter.py +++ b/app/filter.py @@ -285,6 +285,11 @@ class Filter: render_template('logo.html'), features='html.parser')) return + elif src.startswith(G_M_LOGO_URL): + # Re-brand with single-letter Whoogle logo + element['src'] = 'static/img/favicon/apple-icon.png' + element.parent['href'] = 'home' + return elif src.startswith(GOOG_IMG) or GOOG_STATIC in src: element['src'] = BLANK_B64 return @@ -368,6 +373,10 @@ class Filter: # Internal google links (i.e. mail, maps, etc) should still # be forwarded to Google link['href'] = 'https://google.com' + q + elif q.startswith('https://accounts.google.com'): + # Remove Sign-in link + link.decompose() + return elif '/search?q=' in href: # "li:1" implies the query should be interpreted verbatim, # which is accomplished by wrapping the query in double quotes diff --git a/app/utils/results.py b/app/utils/results.py index 55e0079..d981280 100644 --- a/app/utils/results.py +++ b/app/utils/results.py @@ -10,6 +10,7 @@ import re SKIP_ARGS = ['ref_src', 'utm'] SKIP_PREFIX = ['//www.', '//mobile.', '//m.'] GOOG_STATIC = 'www.gstatic.com' +G_M_LOGO_URL = 'https://www.gstatic.com/m/images/icons/googleg.gif' GOOG_IMG = '/images/branding/searchlogo/1x/googlelogo' LOGO_URL = GOOG_IMG + '_desk' BLANK_B64 = ('data:image/png;base64,'