ETag filtering

This commit is contained in:
Kevin R 2023-05-10 11:28:43 +02:00
parent 7358f0c2a4
commit 14a0832973
No known key found for this signature in database
GPG Key ID: A4AD5E0732960C98
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 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

View File

@ -65,8 +65,14 @@ function generateDummyEtag(len, quotes = true, w = false) {
return rtn;
}
browser.webRequest.onHeadersReceived.addListener(
eTagFilter,
{urls: ["<all_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: ["<all_urls>"]},
["blocking", "responseHeaders"]
);
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

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

View File

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