23 Commits

Author SHA1 Message Date
Kevin R
08de228cc5 changes 2024-07-14 14:09:36 +00:00
Banaanae
fcbe2abfdd Fix updating whitelist button
- Button now reflects whitelist status instantly
- Fixed bug where only last site whitelisted displayed properly
- No longer breaks when spammed
- Removed test code
2024-07-14 14:09:36 +00:00
Banaanae
81eb931e02 fix styling; allow removing of sites
still needs to update after press
2024-07-14 14:09:36 +00:00
Banaanae
da90e259bb handle url better; fix saving when edited
... via settings
2024-07-14 14:09:36 +00:00
Banaanae
6a63859635 allowing editing of whitelisted sites in settings
just show data in a text input
no fancy formatting needed!
2024-07-14 14:09:36 +00:00
Banaanae
e86654ed29 first commit for adding whitelist
base functionality
2024-07-14 14:09:36 +00:00
Kevin
deec80b763 Update .gitlab-ci.yml 2024-07-14 14:09:17 +00:00
Kevin
7370e09fd7 Update .gitlab-ci.yml 2024-07-14 14:07:35 +00:00
Kevin R
99b96bcfce Merge remote-tracking branch 'temp2/patch-2' 2024-05-29 17:13:22 +02:00
Mazunki Hoksaas
897c7dc67b remove warning when s is undefined 2024-05-29 17:09:59 +02:00
Evert Heylen
dce06a7f47 Update historyListener.js 2024-05-28 16:28:55 +02:00
Kevin R
92e43b7f61 Fixed URLSearchParams spaces (x sign) bug
See also https://gitlab.com/ClearURLs/ClearUrls/-/merge_requests/108
2023-11-11 15:54:08 +01:00
Kevin R
14a0832973 ETag filtering 2023-05-10 11:28:43 +02:00
Kevin R
7358f0c2a4 Updated README.md 2023-01-31 22:39:53 +01:00
Kevin R
9f52c1e3c8 Updated ZIP 2023-01-31 22:36:55 +01:00
Kevin R
635be47e4c 1.26.1 2023-01-31 22:34:59 +01:00
Kevin R
cf59acb9a8 Merge branch 'master' of gitlab.com:ClearURLs/ClearUrls 2023-01-31 22:31:39 +01:00
Kevin R
04ff2e876b Use „browser_specific_settings“ 2023-01-31 22:31:29 +01:00
Kevin
e672e8cc74 Update README.md 2023-01-02 14:55:38 +00:00
Kevin R
193b3c1299 Bump version 2022-11-26 00:25:11 +01:00
Kevin R
29c8a84e4a Added note to changelog 2022-11-26 00:23:20 +01:00
Kevin R
a32708dcd1 Fixed ETag filtering
Fixed https://github.com/ClearURLs/Addon/issues/276
2022-11-26 00:21:23 +01:00
Kevin R
f1056cd778 Version 1.26.0
+ The popup window is now responsive
2022-11-18 22:26:59 +01:00
15 changed files with 226 additions and 41 deletions

View File

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

View File

@@ -15,6 +15,27 @@ 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] - 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 ## [1.25.0] - 2022-07-27

View File

@@ -4,7 +4,7 @@
[<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) [<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/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) # <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)
**ClearURLs** is an add-on based on the new WebExtensions technology and is optimized for *Firefox* and *Chrome* based browsers. **ClearURLs** is an add-on based on the new WebExtensions technology and is optimized for *Firefox* and *Chrome* based browsers.
@@ -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) * Prevents Yandex from rewriting the search results (to include tracking elements)
## Permissons ## Permissons
Reasoning for needed permissions can be found under [here](https://gitlab.com/KevinRoebert/ClearUrls/issues/159). Reasoning for needed permissions can be found under [here](https://gitlab.com/ClearURLs/ClearUrls/issues/159).
## Screenshot ## Screenshot
![Interface (version 1.14.0)](https://docs.clearurls.xyz/1.22.0/assets/img/interface.png) ![Interface (version 1.14.0)](https://docs.clearurls.xyz/1.22.0/assets/img/interface.png)
@@ -45,14 +45,13 @@ Reasoning for needed permissions can be found under [here](https://gitlab.com/Ke
## CI/CD Artifacts Download (for Firefox- and Chrome-Dev only) ## CI/CD Artifacts Download (for Firefox- and Chrome-Dev only)
Here you can download the packed files for the Firefox- and Chrome-Dev: Here you can download the packed files for the Firefox- and Chrome-Dev:
- [ClearURLs-firefox.zip](https://gitlab.com/KevinRoebert/ClearUrls/-/jobs/artifacts/master/raw/ClearURLs-firefox.zip?job=bundle%20addon%20firefox) - [ClearURLs.zip](https://gitlab.com/ClearURLs/ClearUrls/-/jobs/artifacts/master/raw/ClearURLs.zip?job=bundle%20addon)
- [ClearURLs-chrome.zip](https://gitlab.com/KevinRoebert/ClearUrls/-/jobs/artifacts/master/raw/ClearURLs-chrome.zip?job=bundle%20addon%20chrome)
## Test ## 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/) 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 ## Contribute
If you have any suggestions or complaints, please [create an issue.](https://gitlab.com/KevinRoebert/ClearUrls/issues/new) If you have any suggestions or complaints, please [create an issue.](https://gitlab.com/ClearURLs/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).** **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).**
@@ -65,7 +64,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.* It is not necessary to translate the description field; in the most cases it is empty.*
#### Merge request #### Merge request
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 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
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. 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`. Please push your translation into the folder `_locales/{language code}/messages.json`.

View File

@@ -87,6 +87,14 @@
"message": "Show numbers of cleaned urls", "message": "Show numbers of cleaned urls",
"description": "This string is used as title for the badges switch button on the popup page." "description": "This string is used as title for the badges switch button on the popup page."
}, },
"popup_html_configs_whitelist_button_add": {
"message": "Whitelist Site",
"description": "This string is used as name for the whitelist button on the popup page."
},
"popup_html_configs_whitelist_button_remove": {
"message": "Remove from Whitelist",
"description": "This string is used as name for the whitelist button on the popup page."
},
"popup_html_statistics_head": { "popup_html_statistics_head": {
"message": "Statistics", "message": "Statistics",
"description": "This string is used as title for the statistics on the popup page." "description": "This string is used as title for the statistics on the popup page."
@@ -179,6 +187,10 @@
"message": "The url to the rules.hash file (hash)", "message": "The url to the rules.hash file (hash)",
"description": "This string is used as name for the rule.hash url label." "description": "This string is used as name for the rule.hash url label."
}, },
"setting_whitelist_list_label": {
"message": "Whitelisted sites",
"description": "This string is used as name for the whitelisted sites list label."
},
"setting_types_label": { "setting_types_label": {
"message": "<a href='https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/ResourceType' target='_blank'>Request types</a> (expert level)", "message": "<a href='https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/ResourceType' target='_blank'>Request types</a> (expert level)",
"description": "This string is used as name for the types label." "description": "This string is used as name for the types label."

View File

@@ -47,6 +47,19 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false, request = null) {
let rawRules = provider.getRawRules(); let rawRules = provider.getRawRules();
let urlObject = new URL(url); let urlObject = new URL(url);
/*
* Skip whitelisted sites
*/
for (const site of storage.whitelist) {
if (url.indexOf(site) !== -1) {
return {
"changes": false,
"url": url,
"cancel": false
}
}
}
if (storage.localHostsSkipping && checkLocalURL(urlObject)) { if (storage.localHostsSkipping && checkLocalURL(urlObject)) {
return { return {
"changes": false, "changes": false,
@@ -152,7 +165,7 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false, request = null) {
let finalURL = domain; let finalURL = domain;
if (fields.toString() !== "") finalURL += "?" + fields.toString(); if (fields.toString() !== "") finalURL += "?" + urlSearchParamsToString(fields);
if (fragments.toString() !== "") finalURL += "#" + fragments.toString(); if (fragments.toString() !== "") finalURL += "#" + fragments.toString();
url = finalURL.replace(new RegExp("\\?&"), "?").replace(new RegExp("#&"), "#"); url = finalURL.replace(new RegExp("\\?&"), "?").replace(new RegExp("#&"), "#");

View File

@@ -31,8 +31,16 @@ function eTagFilter(requestDetails) {
continue; 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 // insert dummy etag
requestDetails.responseHeaders[i].value = generateDummyEtag(); requestDetails.responseHeaders[i].value = generateDummyEtag(len, quotes, w);
pushToLog(requestDetails.url, requestDetails.url, translate("eTag_filtering_log")); pushToLog(requestDetails.url, requestDetails.url, translate("eTag_filtering_log"));
@@ -42,12 +50,29 @@ function eTagFilter(requestDetails) {
return {responseHeaders: requestDetails.responseHeaders}; return {responseHeaders: requestDetails.responseHeaders};
} }
function generateDummyEtag() { /**
return Math.random().toString(); * 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;
} }
browser.webRequest.onHeadersReceived.addListener( /**
* Since Firefox 85, eTags can no longer be
* used for tracking users over multiple sites.
*/
if(getBrowser() !== "Firefox") {
browser.webRequest.onHeadersReceived.addListener(
eTagFilter, eTagFilter,
{urls: ["<all_urls>"]}, {urls: ["<all_urls>"]},
["blocking", "responseHeaders"] ["blocking", "responseHeaders"]
); );
}

View File

@@ -27,6 +27,9 @@
function injectFunction() { function injectFunction() {
let ele = document.createElement('script'); let ele = document.createElement('script');
let s = document.getElementsByTagName('script')[0]; let s = document.getElementsByTagName('script')[0];
if (s === undefined) {
return;
}
ele.type = 'text/javascript'; ele.type = 'text/javascript';
ele.textContent = "Object.defineProperty(window, 'rwt', {" + ele.textContent = "Object.defineProperty(window, 'rwt', {" +

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(null,"",'+JSON.stringify(urlAfter)+');'
}).then(() => {}, onError); }).then(() => {}, onError);
} }
} }

View File

@@ -62,6 +62,34 @@ function changeStatistics()
elTotal.textContent = totalCounter.toLocaleString(); elTotal.textContent = totalCounter.toLocaleString();
} }
/**
* Set the whitelist button text
*/
function setWhitelistText()
{
let element = document.getElementById('whitelist_btn');
let currentSite;
browser.tabs.query({active: true, currentWindow: true}, function(tabs) {
currentSite = tabs[0].url;
});
browser.runtime.sendMessage({
function: "getData",
params: ['whitelist']
}).then((data) => {
let siteFound = data.response.some(site => currentSite.indexOf(site) !== -1);
if (siteFound) {
element.classList.replace('btn-primary', 'btn-danger')
element.textContent = translate('popup_html_configs_whitelist_button_remove')
document.getElementById('whitelist_btn').onclick = () => {changeWhitelist(true)};
} else {
element.classList.replace('btn-danger', 'btn-primary')
element.textContent = translate('popup_html_configs_whitelist_button_add')
document.getElementById('whitelist_btn').onclick = () => {changeWhitelist(false)};
}
}).catch(handleError);
}
/** /**
* Set the value for the hashStatus on startUp. * Set the value for the hashStatus on startUp.
*/ */
@@ -155,6 +183,36 @@ function setSwitchButton(id, varname)
element.checked = this[varname]; element.checked = this[varname];
} }
/**
* Adds (or removes) the site the user is on to the whitelist
* Whitelisted sites do not get filtered
* @param {boolean} removeWl If true remove current site instead of adding
*/
function changeWhitelist(removeWl) {
let site;
browser.tabs.query({active: true, currentWindow: true}, function(tabs) { // Couldn't figure out how to access currentUrl var
site = tabs[0].url; // So this is used instead
});
browser.runtime.sendMessage({
function: "getData",
params: ['whitelist']
}).then((data) => {
let siteUrl = new URL(site)
let domain = siteUrl.hostname
if (removeWl) {
data.response = data.response.filter(wlSite => wlSite !== domain)
} else {
data.response.push(domain)
}
browser.runtime.sendMessage({
function: "setData",
params: ['whitelist', data.response]
}).then(() => {
setWhitelistText();
}).catch(handleError);
}).catch(handleError);
}
/** /**
* Reset the global statistic * Reset the global statistic
*/ */
@@ -220,6 +278,7 @@ function setText()
injectText('configs_switch_filter','popup_html_configs_switch_filter'); injectText('configs_switch_filter','popup_html_configs_switch_filter');
injectText('configs_head','popup_html_configs_head'); injectText('configs_head','popup_html_configs_head');
injectText('configs_switch_statistics','configs_switch_statistics'); injectText('configs_switch_statistics','configs_switch_statistics');
setWhitelistText();
document.getElementById('donate').title = translate('donate_button'); document.getElementById('donate').title = translate('donate_button');
} }

View File

@@ -82,6 +82,7 @@ function save() {
saveData("badged_color", pickr.getColor().toHEXA().toString()) saveData("badged_color", pickr.getColor().toHEXA().toString())
.then(() => saveData("ruleURL", document.querySelector('input[name=ruleURL]').value)) .then(() => saveData("ruleURL", document.querySelector('input[name=ruleURL]').value))
.then(() => saveData("hashURL", document.querySelector('input[name=hashURL]').value)) .then(() => saveData("hashURL", document.querySelector('input[name=hashURL]').value))
.then(() => saveData("whitelist", document.querySelector('input[name=whitelist]').value.split(',')))
.then(() => saveData("types", document.querySelector('input[name=types]').value)) .then(() => saveData("types", document.querySelector('input[name=types]').value))
.then(() => saveData("logLimit", Math.max(0, Math.min(5000, document.querySelector('input[name=logLimit]').value)))) .then(() => saveData("logLimit", Math.max(0, Math.min(5000, document.querySelector('input[name=logLimit]').value))))
.then(() => browser.runtime.sendMessage({ .then(() => browser.runtime.sendMessage({
@@ -122,6 +123,7 @@ function getData() {
loadData("ruleURL") loadData("ruleURL")
.then(() => loadData("hashURL")) .then(() => loadData("hashURL"))
.then(() => loadData("whitelist"))
.then(() => loadData("types")) .then(() => loadData("types"))
.then(() => loadData("logLimit")) .then(() => loadData("logLimit"))
.then(logData => { .then(logData => {
@@ -147,6 +149,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);
} }
@@ -202,6 +218,7 @@ function setText() {
document.getElementById('reset_settings_btn').setAttribute('title', translate('setting_html_reset_button_title')); document.getElementById('reset_settings_btn').setAttribute('title', translate('setting_html_reset_button_title'));
document.getElementById('rule_url_label').textContent = translate('setting_rule_url_label'); document.getElementById('rule_url_label').textContent = translate('setting_rule_url_label');
document.getElementById('hash_url_label').textContent = translate('setting_hash_url_label'); document.getElementById('hash_url_label').textContent = translate('setting_hash_url_label');
document.getElementById('whitelist_list_label').textContent = translate('setting_whitelist_list_label');
document.getElementById('types_label').innerHTML = translate('setting_types_label'); document.getElementById('types_label').innerHTML = translate('setting_types_label');
document.getElementById('save_settings_btn').textContent = translate('settings_html_save_button'); document.getElementById('save_settings_btn').textContent = translate('settings_html_save_button');
document.getElementById('save_settings_btn').setAttribute('title', translate('settings_html_save_button_title')); document.getElementById('save_settings_btn').setAttribute('title', translate('settings_html_save_button_title'));

View File

@@ -216,6 +216,7 @@ function initSettings() {
storage.badged_color = "#ffa500"; storage.badged_color = "#ffa500";
storage.hashURL = "https://rules2.clearurls.xyz/rules.minify.hash"; storage.hashURL = "https://rules2.clearurls.xyz/rules.minify.hash";
storage.ruleURL = "https://rules2.clearurls.xyz/data.minify.json"; storage.ruleURL = "https://rules2.clearurls.xyz/data.minify.json";
storage.whitelist = []; // TODO: If we do whitelist per rule, this needs to be obj
storage.contextMenuEnabled = true; storage.contextMenuEnabled = true;
storage.historyListenerEnabled = true; storage.historyListenerEnabled = true;
storage.localHostsSkipping = true; storage.localHostsSkipping = true;

View File

@@ -328,3 +328,30 @@ async function sha256(message) {
return hashArray.map(b => b.toString(16).padStart(2, '0')).join(''); 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

@@ -32,9 +32,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</head> </head>
<body> <body>
<div class="container-fluid" <div class="container-fluid"
style="min-width: 200px;"> style="min-width: 200px">
<div class="row"> <div class="row">
<nav class="col-sm-1 navbar-margin navbar navbar-dark bg-dark"> <nav class="col-sm-12 navbar-margin navbar navbar-dark bg-dark">
<div class="container"> <div class="container">
<span class="navbar-brand"> <span class="navbar-brand">
<span class="float-left"><img src="../img/clearurls.svg" <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>
<div class="row" id="references_section"> <div class="row" id="references_section">
<div class="col-sm-1 text-center"> <div class="col-sm-4 offset-sm-4 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="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> <a id="settings" target="_blank"><span class="fas fa-cog" style="font-size: 1.5em"></span></a>
</div> </div>
</div> </div>
<div class="row" id="config_section"> <div class="row" id="config_section">
<div class="col-sm-1"> <div class="col-sm-4 offset-sm-4">
<h5><b id="configs_head"></b></h5> <h5><b id="configs_head"></b></h5>
<label class="switch"> <label class="switch">
<input type="checkbox" id="globalStatus"> <input type="checkbox" id="globalStatus">
@@ -86,12 +86,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<label id="configs_switch_statistics"></label> <label id="configs_switch_statistics"></label>
</label> </label>
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="text-center">
<button type="button" id="whitelist_btn" class="btn btn-primary btn-sm text-wrap"></button>
</div>
<br /> <br />
</div> </div>
</div> </div>
<div class="row" id="statistic_section"> <div class="row" id="statistic_section">
<div class="col-sm-1"> <div class="col-sm-4 offset-sm-4">
<h5><b id="statistics_head"></b></h5> <h5><b id="statistics_head"></b></h5>
<div class="progress"> <div class="progress">
@@ -133,7 +136,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
<div class="row" id="status_section"> <div class="row" id="status_section">
<div class="col-sm-1"> <div class="col-sm-4 offset-sm-4">
<h5><b id="rules_status_head"></b></h5> <h5><b id="rules_status_head"></b></h5>
<div class="text-center"> <div class="text-center">
<a href="https://gitlab.com/ClearURLs/rules/-/commits/master/data.min.json" <a href="https://gitlab.com/ClearURLs/rules/-/commits/master/data.min.json"
@@ -145,7 +148,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div> </div>
<br /> <br />
<div class="row" id="log_section"> <div class="row" id="log_section">
<div class="col-sm-1"> <div class="col-sm-4 offset-sm-4">
<div class="text-center"> <div class="text-center">
<a id="loggingPage" target="_blank" <a id="loggingPage" target="_blank"
class="btn btn-default btn-sm btn-block text-wrap"></a> class="btn btn-default btn-sm btn-block text-wrap"></a>

View File

@@ -105,6 +105,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<input type="url" id="hashURL" value="" name="hashURL" class="form-control" /> <input type="url" id="hashURL" value="" name="hashURL" class="form-control" />
</p> </p>
<br /> <br />
<p>
<label id="whitelist_list_label"></label><br />
<input type="text" id="whitelist" value="" name="whitelist" class="form-control" />
</p>
<br />
<p> <p>
<label id="types_label"></label><br /> <label id="types_label"></label><br />
<input type="text" id="types" value="" name="types" class="form-control" /> <input type="text" id="types" value="" name="types" class="form-control" />
@@ -157,7 +162,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,13 +1,13 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "ClearURLs", "name": "ClearURLs",
"version": "1.25.0", "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",
"default_locale": "en", "default_locale": "en",
"content_security_policy": "script-src 'self'; object-src 'none'", "content_security_policy": "script-src 'self'; object-src 'none'",
"applications": { "browser_specific_settings": {
"gecko": { "gecko": {
"id": "{74145f27-f039-47ce-a470-a662b129930a}" "id": "{74145f27-f039-47ce-a470-a662b129930a}"
} }