ETag filtering

This commit is contained in:
Kevin R
2023-05-10 11:28:43 +02:00
parent 7358f0c2a4
commit 14a0832973
6 changed files with 33 additions and 9 deletions

View File

@@ -15,10 +15,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Require Firefox >= 55 - Require Firefox >= 55
- Require Chrome >= 37 - Require Chrome >= 37
## [1.27.0] - 2022-XX-XX ## [1.27.0] - 2023-XX-XX
### Fixed ### Fixed
- [#276](https://github.com/ClearURLs/Addon/issues/276) - [#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 ### Compatibility note
- Require Firefox >= 55 - Require Firefox >= 55

View File

@@ -65,8 +65,14 @@ function generateDummyEtag(len, quotes = true, w = false) {
return rtn; return rtn;
} }
browser.webRequest.onHeadersReceived.addListener( /**
eTagFilter, * Since Firefox 85, eTags can no longer be
{urls: ["<all_urls>"]}, * used for tracking users over multiple sites.
["blocking", "responseHeaders"] */
); if(getBrowser() !== "Firefox") {
browser.webRequest.onHeadersReceived.addListener(
eTagFilter,
{urls: ["<all_urls>"]},
["blocking", "responseHeaders"]
);
}

View File

@@ -44,7 +44,7 @@ function historyCleaner(details) {
if(urlBefore !== urlAfter) { if(urlBefore !== urlAfter) {
browser.tabs.executeScript(details.tabId, { browser.tabs.executeScript(details.tabId, {
frameId: details.frameId, frameId: details.frameId,
code: 'history.replaceState({state: "cleaned_history"},"",'+JSON.stringify(urlAfter)+');' code: 'history.replaceState({state: null},"",'+JSON.stringify(urlAfter)+');'
}).then(() => {}, onError); }).then(() => {}, onError);
} }
} }

View File

@@ -147,6 +147,20 @@ function getData() {
changeSwitchButton("domainBlocking", "domainBlocking"); changeSwitchButton("domainBlocking", "domainBlocking");
changeSwitchButton("pingBlocking", "pingBlocking"); changeSwitchButton("pingBlocking", "pingBlocking");
changeSwitchButton("eTagFiltering", "eTagFiltering"); 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); }).catch(handleError);
} }

View File

@@ -157,7 +157,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<span class="slider round"></span> <span class="slider round"></span>
</label> </label>
</p> </p>
<p> <p id="etag_p">
<label id="eTag_filtering_enabled" style="font-weight: bold;"></label><br /> <label id="eTag_filtering_enabled" style="font-weight: bold;"></label><br />
<label class="switch"> <label class="switch">
<input type="checkbox" id="eTagFiltering"> <input type="checkbox" id="eTagFiltering">

View File

@@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "ClearURLs", "name": "ClearURLs",
"version": "1.26.1", "version": "1.27.0",
"author": "Kevin Roebert", "author": "Kevin Roebert",
"description": "__MSG_extension_description__", "description": "__MSG_extension_description__",
"homepage_url": "https://docs.clearurls.xyz", "homepage_url": "https://docs.clearurls.xyz",