From 1b2571788c459203fbfeb7d2b6baa7a82ba07f1b Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 29 Sep 2022 03:34:14 +0200 Subject: [PATCH] Remove anonymizer support Initially implemented in https://github.com/fossar/selfoss/issues/104, these were mostly meant to strip the `Referer` header. But we have long been specifying `rel="noreferer"` on links, which achieved the same effect without going through a questionable third-party website that usually messed up the viewed web page. For better privacy, web browser extensions like NoScript or uBlock Origin and Tor or a VPN provider are probably much better anyway. Closes: https://github.com/fossar/selfoss/issues/612 --- NEWS.md | 1 + assets/js/selfoss-base.js | 18 ------------------ assets/js/templates/Item.jsx | 19 +++++-------------- docs/content/docs/administration/options.md | 6 ------ src/controllers/About.php | 1 - src/helpers/Configuration.php | 3 --- 6 files changed, 6 insertions(+), 42 deletions(-) diff --git a/NEWS.md b/NEWS.md index 44a66a7775..48391639e7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -116,6 +116,7 @@ - Search button is now always on the screen, avoiding the need to scroll to top to be able to use it. ([#1231](https://github.com/fossar/selfoss/issues/1231)) - Button for opening articles, tags, sources and filters in the sidebar, as well as the source and tag links in articles are now real links, allowing to open them in a new tab by middle-clicking them. ([#1216](https://github.com/fossar/selfoss/issues/1216), [#695](https://github.com/fossar/selfoss/issues/695)) - Configuration is no longer managed by F3 framework. ([#1261](https://github.com/fossar/selfoss/pull/1261)) +- Removed `anonymizer` configuration option. ([#1358](https://github.com/fossar/selfoss/pull/1358)) ## 2.18 – 2018-03-05 diff --git a/assets/js/selfoss-base.js b/assets/js/selfoss-base.js index a9cf767be4..b0d14e0e61 100644 --- a/assets/js/selfoss-base.js +++ b/assets/js/selfoss-base.js @@ -381,24 +381,6 @@ var selfoss = { }, - /** - * anonymize links - * - * @return void - * @param parent element - */ - anonymize: function(parent) { - var anonymizer = selfoss.config.anonymizer; - if (anonymizer !== null) { - parent.querySelectorAll('a').forEach((link) => { - if (typeof link.getAttribute('href') !== 'undefined' && !link.getAttribute('href').startsWith(anonymizer)) { - link.setAttribute('href', anonymizer + link.getAttribute('href')); - } - }); - } - }, - - /** * Setup fancyBox image viewer * @param content element diff --git a/assets/js/templates/Item.jsx b/assets/js/templates/Item.jsx index a26b0401b3..71268851f9 100644 --- a/assets/js/templates/Item.jsx +++ b/assets/js/templates/Item.jsx @@ -11,10 +11,6 @@ import { forceReload, makeEntriesLink, makeEntriesLinkLocation } from '../helper import * as icons from '../icons'; import { LocalizationContext } from '../helpers/i18n'; -function anonymize(url) { - return (selfoss.config.anonymizer ?? '') + url; -} - function stopPropagation(event) { event.stopPropagation(); } @@ -294,11 +290,6 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa }); } } - - if (firstExpansion) { - // anonymize - selfoss.anonymize(contentBlock.current); - } } else { // No longer expanded. @@ -392,7 +383,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa {/* icon */} 0 ?
- + {item.strippedTitle}
@@ -485,7 +476,7 @@ export default function Item({ currentTime, item, selected, expanded, setNavExpa