Add "nofollow noopener noreferrer" to all links (#698)

Old iOS 12 devices will pass the Referer HTTP header to the site user clicks.
Websites will know those traffic come from Whoogle search.
Adding "nofollow noopener noreferrer" solves the issue.
main
138138138 2022-03-29 00:11:09 +08:00 committed by GitHub
parent e575fad324
commit 5ecd4fe931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -153,6 +153,7 @@ class Search:
self.request_params.to_dict(flat=True).items() self.request_params.to_dict(flat=True).items()
if self.config.is_safe_key(k)) if self.config.is_safe_key(k))
for link in formatted_results.find_all('a', href=True): for link in formatted_results.find_all('a', href=True):
link['rel'] = "nofollow noopener noreferrer"
if 'search?' not in link['href'] or link['href'].index( if 'search?' not in link['href'] or link['href'].index(
'search?') > 1: 'search?') > 1:
continue continue