From 14a0832973e137f0cbbbb1e9110c1286bc88e319 Mon Sep 17 00:00:00 2001
From: Kevin R
Date: Wed, 10 May 2023 11:28:43 +0200
Subject: [PATCH] ETag filtering
---
CHANGELOG.md | 6 +++++-
core_js/eTagFilter.js | 16 +++++++++++-----
core_js/historyListener.js | 2 +-
core_js/settings.js | 14 ++++++++++++++
html/settings.html | 2 +-
manifest.json | 2 +-
6 files changed, 33 insertions(+), 9 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ed8287..eb95b4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,10 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Require Firefox >= 55
- Require Chrome >= 37
-## [1.27.0] - 2022-XX-XX
+## [1.27.0] - 2023-XX-XX
### Fixed
- [#276](https://github.com/ClearURLs/Addon/issues/276)
+- [#196](https://github.com/ClearURLs/Addon/issues/196)
+
+# Removed
+- ETag filtering for Firefox. Since Firefox 85, ETags can no longer be used for tracking users over multiple sites.
### Compatibility note
- Require Firefox >= 55
diff --git a/core_js/eTagFilter.js b/core_js/eTagFilter.js
index 01cf766..0201e00 100644
--- a/core_js/eTagFilter.js
+++ b/core_js/eTagFilter.js
@@ -65,8 +65,14 @@ function generateDummyEtag(len, quotes = true, w = false) {
return rtn;
}
-browser.webRequest.onHeadersReceived.addListener(
- eTagFilter,
- {urls: [""]},
- ["blocking", "responseHeaders"]
-);
+/**
+ * Since Firefox 85, eTags can no longer be
+ * used for tracking users over multiple sites.
+ */
+if(getBrowser() !== "Firefox") {
+ browser.webRequest.onHeadersReceived.addListener(
+ eTagFilter,
+ {urls: [""]},
+ ["blocking", "responseHeaders"]
+ );
+}
\ No newline at end of file
diff --git a/core_js/historyListener.js b/core_js/historyListener.js
index 762b758..5248d1a 100644
--- a/core_js/historyListener.js
+++ b/core_js/historyListener.js
@@ -44,7 +44,7 @@ function historyCleaner(details) {
if(urlBefore !== urlAfter) {
browser.tabs.executeScript(details.tabId, {
frameId: details.frameId,
- code: 'history.replaceState({state: "cleaned_history"},"",'+JSON.stringify(urlAfter)+');'
+ code: 'history.replaceState({state: null},"",'+JSON.stringify(urlAfter)+');'
}).then(() => {}, onError);
}
}
diff --git a/core_js/settings.js b/core_js/settings.js
index 67f1299..3e6162d 100644
--- a/core_js/settings.js
+++ b/core_js/settings.js
@@ -147,6 +147,20 @@ function getData() {
changeSwitchButton("domainBlocking", "domainBlocking");
changeSwitchButton("pingBlocking", "pingBlocking");
changeSwitchButton("eTagFiltering", "eTagFiltering");
+ })
+ .then(() => {
+ /**
+ * Since Firefox 85, eTags can no longer be
+ * used for tracking users over multiple sites.
+ */
+ browser.runtime.sendMessage({
+ function: "getBrowser",
+ params: []
+ }).then(resp => {
+ if(resp.response === "Firefox") {
+ document.getElementById('etag_p').remove();
+ }
+ }, null);
}).catch(handleError);
}
diff --git a/html/settings.html b/html/settings.html
index 7a37386..f28ded9 100644
--- a/html/settings.html
+++ b/html/settings.html
@@ -157,7 +157,7 @@ along with this program. If not, see .
-
+