68 Commits

Author SHA1 Message Date
Kevin R
eef2bdb753 Merge branch 'master' into poeditor
# Conflicts:
#	_locales/fr/messages.json
2022-07-27 00:57:26 +02:00
Kevin
bd64e39e02 Update messages.json (POEditor.com) 2022-07-26 22:36:36 +00:00
Kevin
4a90d63539 Update messages.json (POEditor.com) 2022-07-26 22:36:35 +00:00
Kevin
6f76f2f167 Update messages.json (POEditor.com) 2022-07-26 22:36:34 +00:00
Kevin
8e1cba2eb7 Update messages.json (POEditor.com) 2022-07-26 22:36:33 +00:00
Kevin
1360111f15 Update messages.json (POEditor.com) 2022-07-26 22:36:32 +00:00
Kevin
f4e5ec70de Update messages.json (POEditor.com) 2022-07-26 22:36:32 +00:00
Kevin
c1b2cdbda0 Update messages.json (POEditor.com) 2022-07-26 22:36:31 +00:00
Kevin
71484d1488 Update messages.json (POEditor.com) 2022-07-26 22:36:30 +00:00
Kevin
394dda1157 Update messages.json (POEditor.com) 2022-07-26 22:36:29 +00:00
Kevin
854460ef50 Update messages.json (POEditor.com) 2022-07-26 22:36:28 +00:00
Kevin
0d49080a52 Update messages.json (POEditor.com) 2022-07-26 22:36:27 +00:00
Kevin
08630fbb7b Update messages.json (POEditor.com) 2022-07-26 22:36:26 +00:00
Kevin
93630cb8db Update messages.json (POEditor.com) 2022-07-26 22:36:26 +00:00
Kevin
d8e0e9fe96 Update messages.json (POEditor.com) 2022-07-26 22:36:25 +00:00
Kevin
42117aff9c Update messages.json (POEditor.com) 2022-07-26 22:36:24 +00:00
Kevin
ddc1dac829 Update messages.json (POEditor.com) 2022-07-26 22:36:23 +00:00
Kevin
2c12ce2def Update messages.json (POEditor.com) 2022-07-26 22:36:22 +00:00
Kevin
1dd91ef59a Update messages.json (POEditor.com) 2022-07-26 22:36:21 +00:00
Kevin
7ef8faef2f Update messages.json (POEditor.com) 2022-07-26 22:36:20 +00:00
Kevin
acacd6e2c4 Update messages.json (POEditor.com) 2022-07-26 22:36:19 +00:00
Kevin
a0ec22affb Update messages.json (POEditor.com) 2022-07-26 22:36:19 +00:00
Kevin
4d43f5cd07 Update messages.json (POEditor.com) 2022-07-26 22:36:18 +00:00
Kevin
7f8c096368 Update messages.json (POEditor.com) 2022-07-26 22:34:37 +00:00
Kevin
ba6fc13937 Update messages.json (POEditor.com) 2022-07-26 22:34:36 +00:00
Kevin
2cd54fcf28 Update messages.json (POEditor.com) 2022-07-26 22:34:36 +00:00
Kevin
8f5404c632 Update messages.json (POEditor.com) 2022-07-26 22:34:35 +00:00
Kevin
b4b2fe5bfe Update messages.json (POEditor.com) 2022-07-26 22:34:34 +00:00
Kevin
4c0b953972 Update messages.json (POEditor.com) 2022-07-26 22:34:33 +00:00
Kevin
d3ddd31d02 Update messages.json (POEditor.com) 2022-07-26 22:34:32 +00:00
Kevin
8f547660b9 Update messages.json (POEditor.com) 2022-07-26 22:34:32 +00:00
Kevin
465b76dbb2 Update messages.json (POEditor.com) 2022-07-26 22:34:31 +00:00
Kevin
7bb4deb83a Update messages.json (POEditor.com) 2022-07-26 22:34:30 +00:00
Kevin
b99263f85d Update messages.json (POEditor.com) 2022-07-26 22:34:29 +00:00
Kevin
d81041afe4 Update messages.json (POEditor.com) 2022-07-26 22:34:28 +00:00
Kevin
09c4504e5e Update messages.json (POEditor.com) 2022-07-26 22:34:27 +00:00
Kevin
1f7a471ec3 Update messages.json (POEditor.com) 2022-07-26 22:34:26 +00:00
Kevin
804e08098c Update messages.json (POEditor.com) 2022-07-26 22:34:26 +00:00
Kevin
55581cc6b8 Update messages.json (POEditor.com) 2022-07-26 22:34:25 +00:00
Kevin
23279d0c70 Update messages.json (POEditor.com) 2022-07-26 22:34:24 +00:00
Kevin
cff3184751 Update messages.json (POEditor.com) 2022-07-26 22:34:23 +00:00
Kevin
3a45f0f3bd Update messages.json (POEditor.com) 2022-07-26 22:34:22 +00:00
Kevin
39aef0bf19 Update messages.json (POEditor.com) 2022-07-26 22:34:22 +00:00
Kevin
56a91be236 Update messages.json (POEditor.com) 2022-07-26 22:34:21 +00:00
Kevin
99439f8dc9 Update messages.json (POEditor.com) 2022-07-26 22:34:20 +00:00
Kevin R
20dd141d3c Merge branch 'master' into poeditor 2022-03-22 21:43:06 +01:00
Kevin
d4c50c037a Update messages.json (POEditor.com) 2022-03-22 20:40:54 +00:00
Kevin
710c1ff527 Update messages.json (POEditor.com) 2022-03-22 20:40:53 +00:00
Kevin
c9be70d0e8 Update messages.json (POEditor.com) 2022-03-22 20:40:52 +00:00
Kevin
188f83b7a0 Update messages.json (POEditor.com) 2022-03-22 20:40:51 +00:00
Kevin
ee32041537 Update messages.json (POEditor.com) 2022-03-22 20:40:50 +00:00
Kevin
e016af23a9 Update messages.json (POEditor.com) 2022-03-22 20:40:49 +00:00
Kevin
003ed087f7 Update messages.json (POEditor.com) 2022-03-22 20:40:49 +00:00
Kevin
cb22c98074 Update messages.json (POEditor.com) 2022-03-22 20:40:48 +00:00
Kevin
f04da7c3b2 Update messages.json (POEditor.com) 2022-03-22 20:40:47 +00:00
Kevin
dde6a52e4b Update messages.json (POEditor.com) 2022-03-22 20:40:46 +00:00
Kevin
d1950a12e8 Update messages.json (POEditor.com) 2022-03-22 20:40:45 +00:00
Kevin
d9c2e895c9 Update messages.json (POEditor.com) 2022-03-22 20:40:44 +00:00
Kevin
b60f46bd34 Update messages.json (POEditor.com) 2022-03-22 20:40:43 +00:00
Kevin
b2547e2564 Update messages.json (POEditor.com) 2022-03-22 20:40:42 +00:00
Kevin
d63727b8b7 Update messages.json (POEditor.com) 2022-03-22 20:40:41 +00:00
Kevin
c3e3148b88 Update messages.json (POEditor.com) 2022-03-22 20:40:40 +00:00
Kevin
ee8916d14a Update messages.json (POEditor.com) 2022-03-22 20:40:39 +00:00
Kevin
7bb4e29768 Update messages.json (POEditor.com) 2022-03-22 20:40:38 +00:00
Kevin
f7fbbbbe88 Update messages.json (POEditor.com) 2022-03-22 20:40:37 +00:00
Kevin
355b724824 Update messages.json (POEditor.com) 2022-03-22 20:40:36 +00:00
Kevin
b53fbc5e76 Update messages.json (POEditor.com) 2022-03-22 20:40:35 +00:00
Kevin
e95a59e5cc Update messages.json (POEditor.com) 2022-03-22 20:40:34 +00:00
39 changed files with 358 additions and 312 deletions

View File

@@ -24,24 +24,26 @@ hash rules:
- data.minify.json
- rules.minify.hash
bundle addon:
bundle addon firefox:
stage: build
script:
- zip ClearURLs -r -FS clearurls.js browser-polyfill.js manifest.json img/* external_js/* html/* core_js/* css/* fonts/* _locales/*
- zip ClearURLs-firefox -r -FS clearurls.js browser-polyfill.js manifest.json img/* external_js/* html/* core_js/* css/* fonts/* _locales/*
only:
- master
artifacts:
paths:
- ClearURLs.zip
- ClearURLs-firefox.zip
#bundle addon chrome:
#stage: build
#script:
#- jq 'del(.applications)' manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json
#- zip ClearURLs-chrome -r -FS clearurls.js browser-polyfill.js manifest.json img/* external_js/* html/* core_js/* css/* fonts/* _locales/*
#only:
# - master
#artifacts:
# paths:
# - ClearURLs-chrome.zip
bundle addon chrome:
stage: build
script:
- jq 'del(.applications)' manifest.json > manifest.json.tmp && mv manifest.json.tmp manifest.json
- zip ClearURLs-chrome -r -FS clearurls.js browser-polyfill.js manifest.json img/* external_js/* html/* core_js/* css/* fonts/* _locales/*
only:
- master
artifacts:
paths:
- ClearURLs-chrome.zip
pages:
stage: deploy
@@ -53,8 +55,6 @@ pages:
- sha256sum public/data/data.min.json | awk '{print $1}' > public/data/rules.min.hash
- node build_tools/minifyDataJSON.js "public/data/data.min.json" "public/data/data.minify.json"
- sha256sum public/data/data.minify.json | awk '{print $1}' > public/data/rules.minify.hash
only:
- master
artifacts:
paths:
- public

View File

@@ -15,27 +15,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Require Firefox >= 55
- Require Chrome >= 37
## [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
- Require Chrome >= 37
## [1.26.0] - 2022-11-18
### Compatibility note
- Require Firefox >= 55
- Require Chrome >= 37
### Changed
- The popup window is now responsive
## [1.25.0] - 2022-07-27

View File

@@ -2,11 +2,11 @@
<a href="https://liberapay.com/kroeb" target="_blank"><img src="https://raw.githubusercontent.com/KevinRoebert/DonateButtons/master/LiberaPay.png" alt="Buy Me A Coffee" height="55"></a>
<a href="https://www.buymeacoffee.com/KevinRoebert" target="_blank"><img src="https://raw.githubusercontent.com/KevinRoebert/DonateButtons/master/BuyMeACoffee.png" alt="Buy Me A Coffee" height="55"></a>
[<img src="https://blog.mozilla.org/addons/files/2020/04/get-the-addon-fx-apr-2020.svg" alt="for Firefox" height="60px">](https://addons.mozilla.org/firefox/addon/clearurls/) [<img src="https://docs.clearurls.xyz/1.22.0/assets/img/MEA-button.png" alt="for Edge" height="60px">](https://microsoftedge.microsoft.com/addons/detail/mdkdmaickkfdekbjdoojfalpbkgaddei)
[<img src="https://blog.mozilla.org/addons/files/2020/04/get-the-addon-fx-apr-2020.svg" alt="for Firefox" height="60px">](https://addons.mozilla.org/firefox/addon/clearurls/) [<img src="https://docs.clearurls.xyz/1.22.0/assets/img/MEA-button.png" alt="for Edge" height="60px">](https://microsoftedge.microsoft.com/addons/detail/mdkdmaickkfdekbjdoojfalpbkgaddei) [<img src="https://storage.googleapis.com/chrome-gcs-uploader.appspot.com/image/WlD8wC6g8khYWPJUsQceQkhXSlv1/HRs9MPufa1J1h5glNhut.png" alt="for Chrome" height="60px">](https://chrome.google.com/webstore/detail/clearurls/lckanjgmijmafbedllaakclkaicjfmnk)
# <sub><img src="https://gitlab.com/ClearURLs/ClearUrls/raw/master/img/clearurls.svg" width="64px" height="64px"></sub> ClearURLs [![Gitter](https://badges.gitter.im/ClearURLs/ClearURLs.svg)](https://gitter.im/ClearURLs/ClearURLs)
# <sub><img src="https://gitlab.com/KevinRoebert/ClearUrls/raw/master/img/clearurls.svg" width="64px" height="64px"></sub> ClearURLs [![Gitter](https://badges.gitter.im/ClearURLs/ClearURLs.svg)](https://gitter.im/ClearURLs/ClearURLs)
**ClearURLs** is an add-on based on the new WebExtensions technology and is optimized for *Firefox* and some *Chrome* based browsers.
**ClearURLs** is an add-on based on the new WebExtensions technology and is optimized for *Firefox* and *Chrome* based browsers.
This extension will automatically remove tracking elements from URLs to help protect your privacy when browsing the Internet,
which is regularly updated by us and can be found [here](https://gitlab.com/anti-tracking/ClearURLs/rules/-/raw/master/data.min.json).
@@ -37,7 +37,7 @@ Indeed most of the above URL is tracking code. Once ClearURLs has cleaned the ad
* Prevents Yandex from rewriting the search results (to include tracking elements)
## Permissons
Reasoning for needed permissions can be found under [here](https://gitlab.com/ClearURLs/ClearUrls/issues/159).
Reasoning for needed permissions can be found under [here](https://gitlab.com/KevinRoebert/ClearUrls/issues/159).
## Screenshot
![Interface (version 1.14.0)](https://docs.clearurls.xyz/1.22.0/assets/img/interface.png)
@@ -45,13 +45,14 @@ Reasoning for needed permissions can be found under [here](https://gitlab.com/Cl
## CI/CD Artifacts Download (for Firefox- and Chrome-Dev only)
Here you can download the packed files for the Firefox- and Chrome-Dev:
- [ClearURLs.zip](https://gitlab.com/ClearURLs/ClearUrls/-/jobs/artifacts/master/raw/ClearURLs.zip?job=bundle%20addon)
- [ClearURLs-firefox.zip](https://gitlab.com/KevinRoebert/ClearUrls/-/jobs/artifacts/master/raw/ClearURLs-firefox.zip?job=bundle%20addon%20firefox)
- [ClearURLs-chrome.zip](https://gitlab.com/KevinRoebert/ClearUrls/-/jobs/artifacts/master/raw/ClearURLs-chrome.zip?job=bundle%20addon%20chrome)
## Test
If you want to test whether ClearURLs works correctly on your system, you can go to this test page: [https://test.clearurls.xyz/](https://test.clearurls.xyz/)
## Contribute
If you have any suggestions or complaints, please [create an issue.](https://gitlab.com/ClearURLs/ClearUrls/issues/new)
If you have any suggestions or complaints, please [create an issue.](https://gitlab.com/KevinRoebert/ClearUrls/issues/new)
**Note: If you have any suggestions or complaints regarding the rules, please [create an issue in this repo](https://gitlab.com/anti-tracking/ClearURLs/rules/-/issues/new) or email us rules.support (at) clearurls.xyz (this mail will automatically create a new issue in this repo).**
@@ -64,7 +65,7 @@ You can choose between two options to contribute. You can create a merge request
It is not necessary to translate the description field; in the most cases it is empty.*
#### Merge request
If you want to create a merge request, you must open the path [`_locales/en/messages.json`](https://gitlab.com/ClearURLs/ClearUrls/-/blob/master/_locales/en/messages.json) in the ClearURLs repo
If you want to create a merge request, you must open the path [`_locales/en/messages.json`](https://github.com/KevinRoebert/ClearUrls/blob/master/_locales/en/messages.json) in the ClearURLs repo
and translate the english terms into terms of your language. Once you have translated all the terms, you make a pull request of your translation.
Please push your translation into the folder `_locales/{language code}/messages.json`.
@@ -94,14 +95,14 @@ We use some third-party scripts in our add-on. The authors and licenses are list
- [WebExtension browser API Polyfill](https://github.com/mozilla/webextension-polyfill) |
Copyright by Mozilla |
[MPL-2.0](https://github.com/mozilla/webextension-polyfill/blob/master/LICENSE)
- [Bootstrap](https://github.com/twbs/bootstrap) |
- [Bootstrap v4.3.1](https://github.com/twbs/bootstrap/tree/v4.3.1) |
Copyright 2011-2016 Twitter, Inc. |
[MIT](https://github.com/twbs/bootstrap/blob/master/LICENSE)
- [jQuery](https://github.com/jquery/jquery/) |
- [jQuery v3.6.0](https://github.com/jquery/jquery/tree/3.6.0) |
Copyright JS Foundation and other contributors |
[MIT](https://jquery.org/license/)
- [DataTables](https://github.com/DataTables/DataTables/tree/master) | Copyright (c) 2008-2015 SpryMedia Limited | [MIT](https://datatables.net/license/)
- [Pickr](https://github.com/Simonwep/pickr/) | Copyright (c) 2018 - 2020 Simon Reinisch |
- [DataTables v1.10.20](https://github.com/DataTables/DataTables/tree/master) | Copyright (c) 2008-2015 SpryMedia Limited | [MIT](https://datatables.net/license/)
- [Pickr v1.7.0](https://github.com/Simonwep/pickr/tree/1.7.0) | Copyright (c) 2018 - 2020 Simon Reinisch |
[MIT](https://github.com/Simonwep/pickr/blob/master/LICENSE)
- [Font Awesome](https://github.com/FortAwesome/Font-Awesome/) | Copyright (c) @fontawesome |
- [Font Awesome v5.12.0](https://github.com/FortAwesome/Font-Awesome/tree/5.12.0) | Copyright (c) @fontawesome |
[Font Awesome Free License](https://github.com/FortAwesome/Font-Awesome/blob/master/LICENSE.txt)

View File

@@ -10,8 +10,8 @@
factory(mod);
global.browser = mod.exports;
}
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (module) {
/* webextension-polyfill - v0.12.0 - Tue May 14 2024 18:01:29 */
})(this, function (module) {
/* webextension-polyfill - v0.4.0 - Wed Feb 06 2019 11:58:31 */
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
@@ -19,11 +19,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
if (!(globalThis.chrome && globalThis.chrome.runtime && globalThis.chrome.runtime.id)) {
throw new Error("This script should only be loaded in a browser extension.");
}
if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) {
if (typeof browser === "undefined" || Object.getPrototypeOf(browser) !== Object.prototype) {
const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received.";
const SEND_RESPONSE_DEPRECATION_WARNING = "Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)";
// Wrapping the bulk of this polyfill in a one-time-use function is a minor
// optimization for Firefox. Since Spidermonkey does not fully parse the
@@ -252,12 +250,6 @@
"minArgs": 3,
"maxArgs": 3,
"singleCallbackArg": true
},
"elements": {
"createSidebarPane": {
"minArgs": 1,
"maxArgs": 1
}
}
}
},
@@ -464,6 +456,10 @@
"minArgs": 0,
"maxArgs": 0
},
"getBrowserInfo": {
"minArgs": 0,
"maxArgs": 0
},
"getPlatformInfo": {
"minArgs": 0,
"maxArgs": 0
@@ -600,14 +596,6 @@
"minArgs": 0,
"maxArgs": 1
},
"goBack": {
"minArgs": 0,
"maxArgs": 1
},
"goForward": {
"minArgs": 0,
"maxArgs": 1
},
"highlight": {
"minArgs": 1,
"maxArgs": 1
@@ -706,6 +694,7 @@
}
}
};
if (Object.keys(apiMetadata).length === 0) {
throw new Error("api-metadata.json has not been included in browser-polyfill");
}
@@ -725,10 +714,12 @@
super(items);
this.createItem = createItem;
}
get(key) {
if (!this.has(key)) {
this.set(key, this.createItem(key));
}
return super.get(key);
}
}
@@ -760,17 +751,13 @@
* promise.
* @param {function} promise.resolve
* The promise's resolution function.
* @param {function} promise.reject
* @param {function} promise.rejection
* The promise's rejection function.
* @param {object} metadata
* Metadata about the wrapped method which has created the callback.
* @param {boolean} metadata.singleCallbackArg
* Whether or not the promise is resolved with only the first
* argument of the callback, alternatively an array of all the
* callback arguments is resolved. By default, if the callback
* function is invoked with only a single argument, that will be
* resolved to the promise, while all arguments will be resolved as
* an array if multiple are given.
* @param {integer} metadata.maxResolvedArgs
* The maximum number of arguments which may be passed to the
* callback created by the wrapped async function.
*
* @returns {function}
* The generated callback function.
@@ -778,7 +765,7 @@
const makeCallback = (promise, metadata) => {
return (...callbackArgs) => {
if (extensionAPIs.runtime.lastError) {
promise.reject(new Error(extensionAPIs.runtime.lastError.message));
promise.reject(extensionAPIs.runtime.lastError);
} else if (metadata.singleCallbackArg || callbackArgs.length <= 1 && metadata.singleCallbackArg !== false) {
promise.resolve(callbackArgs[0]);
} else {
@@ -786,6 +773,7 @@
}
};
};
const pluralizeArguments = numArgs => numArgs == 1 ? "argument" : "arguments";
/**
@@ -803,13 +791,9 @@
* The maximum number of arguments which may be passed to the
* function. If called with more than this number of arguments, the
* wrapper will raise an exception.
* @param {boolean} metadata.singleCallbackArg
* Whether or not the promise is resolved with only the first
* argument of the callback, alternatively an array of all the
* callback arguments is resolved. By default, if the callback
* function is invoked with only a single argument, that will be
* resolved to the promise, while all arguments will be resolved as
* an array if multiple are given.
* @param {integer} metadata.maxResolvedArgs
* The maximum number of arguments which may be passed to the
* callback created by the wrapped async function.
*
* @returns {function(object, ...*)}
* The generated wrapper function.
@@ -819,37 +803,35 @@
if (args.length < metadata.minArgs) {
throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
}
if (args.length > metadata.maxArgs) {
throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
}
return new Promise((resolve, reject) => {
if (metadata.fallbackToNoCallback) {
// This API method has currently no callback on Chrome, but it return a promise on Firefox,
// and so the polyfill will try to call it with a callback first, and it will fallback
// to not passing the callback if the first call fails.
try {
target[name](...args, makeCallback({
resolve,
reject
}, metadata));
target[name](...args, makeCallback({ resolve, reject }, metadata));
} catch (cbError) {
console.warn(`${name} API method doesn't seem to support the callback parameter, ` + "falling back to call it without a callback: ", cbError);
target[name](...args);
// Update the API method metadata, so that the next API calls will not try to
// use the unsupported callback anymore.
metadata.fallbackToNoCallback = false;
metadata.noCallback = true;
resolve();
}
} else if (metadata.noCallback) {
target[name](...args);
resolve();
} else {
target[name](...args, makeCallback({
resolve,
reject
}, metadata));
target[name](...args, makeCallback({ resolve, reject }, metadata));
}
});
};
@@ -881,6 +863,7 @@
}
});
};
let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
/**
@@ -912,14 +895,18 @@
has(proxyTarget, prop) {
return prop in target || prop in cache;
},
get(proxyTarget, prop, receiver) {
if (prop in cache) {
return cache[prop];
}
if (!(prop in target)) {
return undefined;
}
let value = target[prop];
if (typeof value === "function") {
// This is a method on the underlying object. Check if we need to do
// any wrapping.
@@ -942,9 +929,6 @@
// of. Create a sub-object wrapper for it with the appropriate child
// metadata.
value = wrapObject(value, wrappers[prop], metadata[prop]);
} else if (hasOwnProperty(metadata, "*")) {
// Wrap all properties in * namespace.
value = wrapObject(value, wrappers[prop], metadata["*"]);
} else {
// We don't need to do any wrapping for this property,
// so just forward all access to the underlying object.
@@ -958,11 +942,14 @@
target[prop] = value;
}
});
return value;
}
cache[prop] = value;
return value;
},
set(proxyTarget, prop, value, receiver) {
if (prop in cache) {
cache[prop] = value;
@@ -971,9 +958,11 @@
}
return true;
},
defineProperty(proxyTarget, prop, desc) {
return Reflect.defineProperty(cache, prop, desc);
},
deleteProperty(proxyTarget, prop) {
return Reflect.deleteProperty(cache, prop);
}
@@ -1013,36 +1002,19 @@
addListener(target, listener, ...args) {
target.addListener(wrapperMap.get(listener), ...args);
},
hasListener(target, listener) {
return target.hasListener(wrapperMap.get(listener));
},
removeListener(target, listener) {
target.removeListener(wrapperMap.get(listener));
}
});
const onRequestFinishedWrappers = new DefaultWeakMap(listener => {
if (typeof listener !== "function") {
return listener;
}
/**
* Wraps an onRequestFinished listener function so that it will return a
* `getContent()` property which returns a `Promise` rather than using a
* callback API.
*
* @param {object} req
* The HAR entry object representing the network request.
*/
return function onRequestFinished(req) {
const wrappedReq = wrapObject(req, {} /* wrappers */, {
getContent: {
minArgs: 0,
maxArgs: 0
}
});
listener(wrappedReq);
};
});
// Keep track if the deprecation warning has been logged at least once.
let loggedSendResponseDeprecationWarning = false;
const onMessageWrappers = new DefaultWeakMap(listener => {
if (typeof listener !== "function") {
return listener;
@@ -1067,19 +1039,26 @@
*/
return function onMessage(message, sender, sendResponse) {
let didCallSendResponse = false;
let wrappedSendResponse;
let sendResponsePromise = new Promise(resolve => {
wrappedSendResponse = function (response) {
if (!loggedSendResponseDeprecationWarning) {
console.warn(SEND_RESPONSE_DEPRECATION_WARNING, new Error().stack);
loggedSendResponseDeprecationWarning = true;
}
didCallSendResponse = true;
resolve(response);
};
});
let result;
try {
result = listener(message, sender, wrappedSendResponse);
} catch (err) {
result = Promise.reject(err);
}
const isResultThenable = result !== true && isThenable(result);
// If the listener didn't returned true or a Promise, or called
@@ -1106,6 +1085,7 @@
} else {
message = "An unexpected error occurred";
}
sendResponse({
__mozWebExtensionPolyfillReject__: true,
message
@@ -1129,10 +1109,8 @@
return true;
};
});
const wrappedSendMessageCallback = ({
reject,
resolve
}, reply) => {
const wrappedSendMessageCallback = ({ reject, resolve }, reply) => {
if (extensionAPIs.runtime.lastError) {
// Detect when none of the listeners replied to the sendMessage call and resolve
// the promise to undefined as in Firefox.
@@ -1140,7 +1118,7 @@
if (extensionAPIs.runtime.lastError.message === CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE) {
resolve();
} else {
reject(new Error(extensionAPIs.runtime.lastError.message));
reject(extensionAPIs.runtime.lastError);
}
} else if (reply && reply.__mozWebExtensionPolyfillReject__) {
// Convert back the JSON representation of the error into
@@ -1150,68 +1128,52 @@
resolve(reply);
}
};
const wrappedSendMessage = (name, metadata, apiNamespaceObj, ...args) => {
if (args.length < metadata.minArgs) {
throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
}
if (args.length > metadata.maxArgs) {
throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
}
return new Promise((resolve, reject) => {
const wrappedCb = wrappedSendMessageCallback.bind(null, {
resolve,
reject
});
const wrappedCb = wrappedSendMessageCallback.bind(null, { resolve, reject });
args.push(wrappedCb);
apiNamespaceObj.sendMessage(...args);
});
};
const staticWrappers = {
devtools: {
network: {
onRequestFinished: wrapEvent(onRequestFinishedWrappers)
}
},
runtime: {
onMessage: wrapEvent(onMessageWrappers),
onMessageExternal: wrapEvent(onMessageWrappers),
sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
minArgs: 1,
maxArgs: 3
})
sendMessage: wrappedSendMessage.bind(null, "sendMessage", { minArgs: 1, maxArgs: 3 })
},
tabs: {
sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
minArgs: 2,
maxArgs: 3
})
sendMessage: wrappedSendMessage.bind(null, "sendMessage", { minArgs: 2, maxArgs: 3 })
}
};
const settingMetadata = {
clear: {
minArgs: 1,
maxArgs: 1
},
get: {
minArgs: 1,
maxArgs: 1
},
set: {
minArgs: 1,
maxArgs: 1
}
clear: { minArgs: 1, maxArgs: 1 },
get: { minArgs: 1, maxArgs: 1 },
set: { minArgs: 1, maxArgs: 1 }
};
apiMetadata.privacy = {
network: {
"*": settingMetadata
networkPredictionEnabled: settingMetadata,
webRTCIPHandlingPolicy: settingMetadata
},
services: {
"*": settingMetadata
passwordSavingEnabled: settingMetadata
},
websites: {
"*": settingMetadata
hyperlinkAuditingEnabled: settingMetadata,
referrersEnabled: settingMetadata
}
};
return wrapObject(extensionAPIs, staticWrappers, apiMetadata);
};
@@ -1219,7 +1181,6 @@
// `module` variable available.
module.exports = wrapAPIs(chrome);
} else {
module.exports = globalThis.browser;
module.exports = browser;
}
});
//# sourceMappingURL=browser-polyfill.js.map

View File

@@ -152,7 +152,7 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false, request = null) {
let finalURL = domain;
if (fields.toString() !== "") finalURL += "?" + urlSearchParamsToString(fields);
if (fields.toString() !== "") finalURL += "?" + fields.toString();
if (fragments.toString() !== "") finalURL += "#" + fragments.toString();
url = finalURL.replace(new RegExp("\\?&"), "?").replace(new RegExp("#&"), "#");

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -31,16 +31,8 @@ function eTagFilter(requestDetails) {
continue;
}
const etag = header.value.toLowerCase();
const w = etag.startsWith('w');
const quotes = etag.endsWith('"');
let len = etag.length;
if (w) len -= 2;
if (quotes) len -= 2;
// insert dummy etag
requestDetails.responseHeaders[i].value = generateDummyEtag(len, quotes, w);
requestDetails.responseHeaders[i].value = generateDummyEtag();
pushToLog(requestDetails.url, requestDetails.url, translate("eTag_filtering_log"));
@@ -50,29 +42,12 @@ function eTagFilter(requestDetails) {
return {responseHeaders: requestDetails.responseHeaders};
}
/**
* Generates a random ETag.
*
* Must be ASCII characters placed between double quotes.
* See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
*/
function generateDummyEtag(len, quotes = true, w = false) {
let rtn = randomASCII(len);
if (quotes) rtn = '"' + rtn + '"';
if (w) rtn = 'W/' + rtn;
return rtn;
function generateDummyEtag() {
return Math.random().toString();
}
/**
* Since Firefox 85, eTags can no longer be
* used for tracking users over multiple sites.
*/
if(getBrowser() !== "Firefox") {
browser.webRequest.onHeadersReceived.addListener(
browser.webRequest.onHeadersReceived.addListener(
eTagFilter,
{urls: ["<all_urls>"]},
["blocking", "responseHeaders"]
);
}
);

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -27,9 +27,6 @@
function injectFunction() {
let ele = document.createElement('script');
let s = document.getElementsByTagName('script')[0];
if (s === undefined) {
return;
}
ele.type = 'text/javascript';
ele.textContent = "Object.defineProperty(window, 'rwt', {" +

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -44,7 +44,7 @@ function historyCleaner(details) {
if(urlBefore !== urlAfter) {
browser.tabs.executeScript(details.tabId, {
frameId: details.frameId,
code: 'history.replaceState(null,"",'+JSON.stringify(urlAfter)+');'
code: 'history.replaceState({state: "cleaned_history"},"",'+JSON.stringify(urlAfter)+');'
}).then(() => {}, onError);
}
}

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -147,20 +147,6 @@ 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

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -328,30 +328,3 @@ async function sha256(message) {
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}
/**
* Generates a non-secure random ASCII string of length {@code len}.
*
* @returns non-secure random ASCII
*/
function randomASCII(len) {
return [...Array(len)].map(() => (~~(Math.random() * 36)).toString(36)).join('');
}
/**
* Returns an URLSearchParams as string.
* Does handle spaces correctly.
*/
function urlSearchParamsToString(searchParams) {
const rtn = []
searchParams.forEach((value, key) => {
if (value) {
rtn.push(key + '=' + value)
} else {
rtn.push(key)
}
})
return rtn.join('&')
}

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

10
css/bootstrap.min.css vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2025 Kevin Röbert
* Copyright (c) 2017-2020 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
external_js/jquery-3.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
<!--
ClearURLs
Copyright (c) 2017-2025 Kevin Röbert
Copyright (c) 2017-2020 Kevin Röbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,6 +1,6 @@
<!--
ClearURLs
Copyright (c) 2017-2025 Kevin Röbert
Copyright (c) 2017-2020 Kevin Röbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -53,15 +53,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
direction: ltr;
cursor: pointer;
}
#logTable_wrapper .dt-paging {
margin-top: 20px;
margin-bottom: 20px;
}
#logTable_wrapper .dt-search, .dt-length{
margin-bottom: 20px;
}
</style>
</head>
<body>
@@ -121,7 +112,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="../browser-polyfill.js"></script>
<script src="../external_js/jquery-3.7.1.min.js"></script>
<script src="../external_js/jquery-3.6.0.min.js"></script>
<script src="../external_js/datatables.min.js"></script>
<script src="../core_js/log.js"></script>
<script src="../core_js/write_version.js"></script>

View File

@@ -1,6 +1,6 @@
<!--
ClearURLs
Copyright (c) 2017-2025 Kevin Röbert
Copyright (c) 2017-2020 Kevin Röbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -32,9 +32,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</head>
<body>
<div class="container-fluid"
style="min-width: 200px">
style="min-width: 200px;">
<div class="row">
<nav class="col-sm-12 navbar-margin navbar navbar-dark bg-dark">
<nav class="col-sm-1 navbar-margin navbar navbar-dark bg-dark">
<div class="container">
<span class="navbar-brand">
<span class="float-left"><img src="../img/clearurls.svg"
@@ -53,14 +53,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<div class="row" id="references_section">
<div class="col-sm-4 offset-sm-4 text-center">
<div class="col-sm-1 text-center">
<a id="cleaning_tools" target="_blank"><span class="fas fa-tools" style="font-size: 1.5em; margin-right: 1em;"></span></a>
<a id="settings" target="_blank"><span class="fas fa-cog" style="font-size: 1.5em"></span></a>
</div>
</div>
<div class="row" id="config_section">
<div class="col-sm-4 offset-sm-4">
<div class="col-sm-1">
<h5><b id="configs_head"></b></h5>
<label class="switch">
<input type="checkbox" id="globalStatus">
@@ -91,7 +91,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<div class="row" id="statistic_section">
<div class="col-sm-4 offset-sm-4">
<div class="col-sm-1">
<h5><b id="statistics_head"></b></h5>
<div class="progress">
@@ -133,7 +133,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<div class="row" id="status_section">
<div class="col-sm-4 offset-sm-4">
<div class="col-sm-1">
<h5><b id="rules_status_head"></b></h5>
<div class="text-center">
<a href="https://gitlab.com/ClearURLs/rules/-/commits/master/data.min.json"
@@ -145,7 +145,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<br />
<div class="row" id="log_section">
<div class="col-sm-4 offset-sm-4">
<div class="col-sm-1">
<div class="text-center">
<a id="loggingPage" target="_blank"
class="btn btn-default btn-sm btn-block text-wrap"></a>

View File

@@ -1,6 +1,6 @@
<!--
ClearURLs
Copyright (c) 2017-2025 Kevin Röbert
Copyright (c) 2017-2020 Kevin Röbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -157,7 +157,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<span class="slider round"></span>
</label>
</p>
<p id="etag_p">
<p>
<label id="eTag_filtering_enabled" style="font-weight: bold;"></label><br />
<label class="switch">
<input type="checkbox" id="eTagFiltering">

View File

@@ -1,6 +1,6 @@
<!--
ClearURLs
Copyright (c) 2017-2025 Kevin Röbert
Copyright (c) 2017-2020 Kevin Röbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by

View File

@@ -1,13 +1,13 @@
{
"manifest_version": 2,
"name": "ClearURLs",
"version": "1.27.0",
"version": "1.25.0",
"author": "Kevin Roebert",
"description": "__MSG_extension_description__",
"homepage_url": "https://docs.clearurls.xyz",
"default_locale": "en",
"content_security_policy": "script-src 'self'; object-src 'none'",
"browser_specific_settings": {
"applications": {
"gecko": {
"id": "{74145f27-f039-47ce-a470-a662b129930a}"
}