Skip to content

Commit 14a0832

Browse files
committed
ETag filtering
1 parent 7358f0c commit 14a0832

File tree

6 files changed

+33
-9
lines changed

6 files changed

+33
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Require Firefox >= 55
1616
- Require Chrome >= 37
1717

18-
## [1.27.0] - 2022-XX-XX
18+
## [1.27.0] - 2023-XX-XX
1919

2020
### Fixed
2121
- [#276](https://github.com/ClearURLs/Addon/issues/276)
22+
- [#196](https://github.com/ClearURLs/Addon/issues/196)
23+
24+
# Removed
25+
- ETag filtering for Firefox. Since Firefox 85, ETags can no longer be used for tracking users over multiple sites.
2226

2327
### Compatibility note
2428
- Require Firefox >= 55

core_js/eTagFilter.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,14 @@ function generateDummyEtag(len, quotes = true, w = false) {
6565
return rtn;
6666
}
6767

68-
browser.webRequest.onHeadersReceived.addListener(
69-
eTagFilter,
70-
{urls: ["<all_urls>"]},
71-
["blocking", "responseHeaders"]
72-
);
68+
/**
69+
* Since Firefox 85, eTags can no longer be
70+
* used for tracking users over multiple sites.
71+
*/
72+
if(getBrowser() !== "Firefox") {
73+
browser.webRequest.onHeadersReceived.addListener(
74+
eTagFilter,
75+
{urls: ["<all_urls>"]},
76+
["blocking", "responseHeaders"]
77+
);
78+
}

core_js/historyListener.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function historyCleaner(details) {
4444
if(urlBefore !== urlAfter) {
4545
browser.tabs.executeScript(details.tabId, {
4646
frameId: details.frameId,
47-
code: 'history.replaceState({state: "cleaned_history"},"",'+JSON.stringify(urlAfter)+');'
47+
code: 'history.replaceState({state: null},"",'+JSON.stringify(urlAfter)+');'
4848
}).then(() => {}, onError);
4949
}
5050
}

core_js/settings.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,20 @@ function getData() {
147147
changeSwitchButton("domainBlocking", "domainBlocking");
148148
changeSwitchButton("pingBlocking", "pingBlocking");
149149
changeSwitchButton("eTagFiltering", "eTagFiltering");
150+
})
151+
.then(() => {
152+
/**
153+
* Since Firefox 85, eTags can no longer be
154+
* used for tracking users over multiple sites.
155+
*/
156+
browser.runtime.sendMessage({
157+
function: "getBrowser",
158+
params: []
159+
}).then(resp => {
160+
if(resp.response === "Firefox") {
161+
document.getElementById('etag_p').remove();
162+
}
163+
}, null);
150164
}).catch(handleError);
151165
}
152166

html/settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
<span class="slider round"></span>
158158
</label>
159159
</p>
160-
<p>
160+
<p id="etag_p">
161161
<label id="eTag_filtering_enabled" style="font-weight: bold;"></label><br />
162162
<label class="switch">
163163
<input type="checkbox" id="eTagFiltering">

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "ClearURLs",
4-
"version": "1.26.1",
4+
"version": "1.27.0",
55
"author": "Kevin Roebert",
66
"description": "__MSG_extension_description__",
77
"homepage_url": "https://docs.clearurls.xyz",

0 commit comments

Comments
 (0)