parent
08fe25dc0d
commit
50542fa6a3
|
@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [1.11.0] - 2020-01-06
|
||||
|
||||
### Added
|
||||
- Added hyperlink auditing blocking [#184](https://gitlab.com/KevinRoebert/ClearUrls/issues/184)
|
||||
|
||||
### Compatibility note
|
||||
- Require Firefox >= 55
|
||||
- Require Chrome >= 22
|
||||
|
||||
## [1.10.0] - 2020-01-03
|
||||
|
||||
### Compatibility note
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
"message": "Diese Domain wurde blockiert",
|
||||
"description": "Diese Zeichenfolge wird für blockierte Domäns im ClearURL-Protokoll verwendet."
|
||||
},
|
||||
"log_ping_blocked": {
|
||||
"message": "Diese Hyperlink Auditing Anfrage wurde blockiert",
|
||||
"description": "Diese Zeichenfolge wird für blockierte Hyperlink Auditing Anfragen im ClearURL-Protokoll verwendet."
|
||||
},
|
||||
"check_os_log": {
|
||||
"message": "[ClearURLs]: Protokoll-Listener wurde hinzugefügt.",
|
||||
"description": "Diese Zeichenfolge wird beim Start des ClearURL-Protokolls verwendet."
|
||||
|
@ -312,5 +316,13 @@
|
|||
"domain_blocking_enabled_title": {
|
||||
"message": "Erlaube Domain-Blocking (Kann zu Problemen auf Seiten führen, die AdBlocker nicht erlauben)",
|
||||
"description": "Diese Zeichenkette wird als Titel für das Domain-Blocking verwendet."
|
||||
},
|
||||
"ping_blocking_enabled": {
|
||||
"message": "Blockiere Hyperlink Auditing Anfragen (Siehe auch <a href='https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing' target='_blank'>diese Spezifikation</a>)",
|
||||
"description": "Diese Zeichenkette wird als Beschreibung für das Hyperlink Auditing-Blocking verwendet."
|
||||
},
|
||||
"ping_blocking_enabled_title": {
|
||||
"message": "Blockiere Hyperlink Auditing Anfragen",
|
||||
"description": "Diese Zeichenkette wird als Titel für das Hyperlink Auditing-Blocking verwendet."
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,10 @@
|
|||
"message": "This domain is blocked",
|
||||
"description": "This string is used on blocked domains in the ClearURLs log."
|
||||
},
|
||||
"log_ping_blocked": {
|
||||
"message": "This hyperlink auditing was blocked",
|
||||
"description": "This string is used on hyperlink auditing in the ClearURLs log."
|
||||
},
|
||||
"check_os_log": {
|
||||
"message": "[ClearURLs]: Log listener is added.",
|
||||
"description": "This string is used on ClearURLs log startup."
|
||||
|
@ -312,5 +316,13 @@
|
|||
"domain_blocking_enabled_title": {
|
||||
"message": "Allow domain blocking (Can lead to problems on pages that do not allow AdBlockers)",
|
||||
"description": "This string is used as title for the domain blocking switch"
|
||||
},
|
||||
"ping_blocking_enabled": {
|
||||
"message": "Block hyperlink auditing (See also <a href='https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing' target='_blank'>this article</a>)",
|
||||
"description": "This string is used as label for the hyperlink auditing blocking switch"
|
||||
},
|
||||
"ping_blocking_enabled_title": {
|
||||
"message": "Block hyperlink auditing",
|
||||
"description": "This string is used as title for the hyperlink auditing blocking switch"
|
||||
}
|
||||
}
|
||||
|
|
74
clearurls.js
74
clearurls.js
|
@ -70,20 +70,7 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false) {
|
|||
pushToLog(beforeReplace, url, rawRule);
|
||||
}
|
||||
|
||||
if (badges[tabid] == null) badges[tabid] = 0;
|
||||
|
||||
if (!quiet) increaseURLCounter();
|
||||
|
||||
checkOSAndroid().then((res) => {
|
||||
if (!res) {
|
||||
if (storage.badgedStatus && !quiet) {
|
||||
browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid});
|
||||
} else {
|
||||
browser.browserAction.setBadgeText({text: "", tabId: tabid});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
increaseBadged(quiet);
|
||||
changes = true;
|
||||
}
|
||||
});
|
||||
|
@ -144,20 +131,7 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false) {
|
|||
if (!quiet) pushToLog(tempBeforeURL, tempURL, rule);
|
||||
}
|
||||
|
||||
if (badges[tabid] == null) badges[tabid] = 0;
|
||||
|
||||
if (!quiet) increaseURLCounter();
|
||||
|
||||
checkOSAndroid().then((res) => {
|
||||
if (!res) {
|
||||
if (storage.badgedStatus && !quiet) {
|
||||
browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid});
|
||||
} else {
|
||||
browser.browserAction.setBadgeText({text: "", tabId: tabid});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
increaseBadged(quiet);
|
||||
changes = true;
|
||||
}
|
||||
});
|
||||
|
@ -172,22 +146,7 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false) {
|
|||
|
||||
if (provider.isCaneling() && storage.domainBlocking) {
|
||||
if (!quiet) pushToLog(pureUrl, pureUrl, translate('log_domain_blocked'));
|
||||
if (badges[tabid] == null) {
|
||||
badges[tabid] = 0;
|
||||
}
|
||||
|
||||
if (!quiet) increaseURLCounter();
|
||||
|
||||
checkOSAndroid().then((res) => {
|
||||
if (!res) {
|
||||
if (storage.badgedStatus && !quiet) {
|
||||
browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid});
|
||||
} else {
|
||||
browser.browserAction.setBadgeText({text: "", tabId: tabid});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
increaseBadged(quiet);
|
||||
cancel = true;
|
||||
}
|
||||
|
||||
|
@ -598,6 +557,12 @@ function start() {
|
|||
"cancel": false
|
||||
};
|
||||
|
||||
if(storage.pingBlocking && storage.pingRequestTypes.includes(request.type)) {
|
||||
pushToLog(request.url, request.url, translate('log_ping_blocked'));
|
||||
increaseBadged();
|
||||
return {cancel: true};
|
||||
}
|
||||
|
||||
/*
|
||||
* Call for every provider the removeFieldsFormURL method.
|
||||
*/
|
||||
|
@ -726,7 +691,7 @@ function start() {
|
|||
*/
|
||||
browser.webRequest.onBeforeRequest.addListener(
|
||||
promise,
|
||||
{urls: ["<all_urls>"], types: getData("types")},
|
||||
{urls: ["<all_urls>"], types: getData("types").concat(getData("pingRequestTypes"))},
|
||||
["blocking"]
|
||||
);
|
||||
}
|
||||
|
@ -761,3 +726,22 @@ function pushToLog(beforeProcessing, afterProcessing, rule) {
|
|||
deferSaveOnDisk('log');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Increases the badged by one.
|
||||
*/
|
||||
function increaseBadged(quiet = false) {
|
||||
if (badges[tabid] == null) badges[tabid] = 0;
|
||||
|
||||
if (!quiet) increaseURLCounter();
|
||||
|
||||
checkOSAndroid().then((res) => {
|
||||
if (!res) {
|
||||
if (storage.badgedStatus && !quiet) {
|
||||
browser.browserAction.setBadgeText({text: (++badges[tabid]).toString(), tabId: tabid});
|
||||
} else {
|
||||
browser.browserAction.setBadgeText({text: "", tabId: tabid});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -114,12 +114,14 @@ function getData()
|
|||
.then(() => loadData("localHostsSkipping"))
|
||||
.then(() => loadData("referralMarketing"))
|
||||
.then(() => loadData("domainBlocking"))
|
||||
.then(() => loadData("pingBlocking"))
|
||||
.then(() => {
|
||||
changeSwitchButton("localHostsSkipping", "localHostsSkipping");
|
||||
changeSwitchButton("historyListenerEnabled", "historyListenerEnabled");
|
||||
changeSwitchButton("contextMenuEnabled", "contextMenuEnabled");
|
||||
changeSwitchButton("referralMarketing", "referralMarketing");
|
||||
changeSwitchButton("domainBlocking", "domainBlocking");
|
||||
changeSwitchButton("pingBlocking", "pingBlocking");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -185,6 +187,8 @@ function setText()
|
|||
$('#importSettings').prop('title', translate('setting_html_import_button_title'));
|
||||
injectText("referral_marketing_enabled", "referral_marketing_enabled");
|
||||
injectText("domain_blocking_enabled", "domain_blocking_enabled");
|
||||
$('#ping_blocking_enabled').html(translate('ping_blocking_enabled'))
|
||||
.prop('title', translate('ping_blocking_enabled_title'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -209,11 +209,14 @@ function initSettings() {
|
|||
storage.referralMarketing = false;
|
||||
storage.logLimit = -1;
|
||||
storage.domainBlocking = true;
|
||||
storage.pingBlocking = true;
|
||||
|
||||
if (getBrowser() === "Firefox") {
|
||||
storage.types = ["font", "image", "imageset", "main_frame", "media", "object", "object_subrequest", "other", "script", "stylesheet", "sub_frame", "websocket", "xbl", "xml_dtd", "xmlhttprequest", "xslt"];
|
||||
storage.pingRequestTypes = ["ping", "beacon"];
|
||||
} else if (getBrowser() === "Chrome") {
|
||||
storage.types = ["main_frame", "sub_frame", "stylesheet", "script", "image", "font", "object", "xmlhttprequest", "ping", "csp_report", "media", "websocket", "other"];
|
||||
storage.pingRequestTypes = ["ping"];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ function decodeURL(url) {
|
|||
return rtn;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Gets the value of at `key` an object. If the resolved value is `undefined`, the `defaultValue` is returned in its place.
|
||||
*
|
||||
* @param {string} key the key of the object
|
||||
|
|
|
@ -95,7 +95,8 @@
|
|||
"uact",
|
||||
"aqs",
|
||||
"sourceid",
|
||||
"sxsrf"
|
||||
"sxsrf",
|
||||
"rlz"
|
||||
],
|
||||
"referralMarketing": [
|
||||
"referrer"
|
||||
|
@ -184,7 +185,8 @@
|
|||
"(%3F)?cmpid",
|
||||
"(%3F)?os_ehash",
|
||||
"(%3F)?_ga",
|
||||
"(%3F)?__twitter_impression"
|
||||
"(%3F)?__twitter_impression",
|
||||
"(%3F)?wt_mc"
|
||||
],
|
||||
"referralMarketing": [],
|
||||
"rawRules": [],
|
||||
|
@ -1105,6 +1107,44 @@
|
|||
"exceptions": [],
|
||||
"redirections": [],
|
||||
"forceRedirection": false
|
||||
},
|
||||
"disq.us": {
|
||||
"urlPattern": "(https:\\/\\/|http:\\/\\/)([a-zA-Z0-9-.]*\\.)?(disq)(\\.us).*",
|
||||
"completeProvider": false,
|
||||
"rules": [
|
||||
"cuid"
|
||||
],
|
||||
"referralMarketing": [],
|
||||
"rawRules": [],
|
||||
"exceptions": [],
|
||||
"redirections": [
|
||||
".*url=([^&]*)"
|
||||
],
|
||||
"forceRedirection": false
|
||||
},
|
||||
"liberation.fr": {
|
||||
"urlPattern": "(https:\\/\\/|http:\\/\\/)([a-zA-Z0-9-.]*\\.)?(liberation)(\\.fr).*",
|
||||
"completeProvider": false,
|
||||
"rules": [
|
||||
"Echobox"
|
||||
],
|
||||
"referralMarketing": [],
|
||||
"rawRules": [],
|
||||
"exceptions": [],
|
||||
"redirections": [],
|
||||
"forceRedirection": false
|
||||
},
|
||||
"anonym.to": {
|
||||
"urlPattern": "(https:\\/\\/|http:\\/\\/)([a-zA-Z0-9-.]*\\.)?(anonym)(\\.to).*",
|
||||
"completeProvider": false,
|
||||
"rules": [],
|
||||
"referralMarketing": [],
|
||||
"rawRules": [],
|
||||
"exceptions": [],
|
||||
"redirections": [
|
||||
".*\\?([^&]*)"
|
||||
],
|
||||
"forceRedirection": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,6 +98,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
</span>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<p>
|
||||
<label id="rule_url_label"></label><br />
|
||||
<input type="url" id="ruleURL" value="" name="ruleURL" class="form-control" />
|
||||
|
@ -125,7 +126,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
<span class="slider round"></span>
|
||||
</label>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<label id="local_hosts_skipping" style="font-weight: bold;"></label><br />
|
||||
<label class="switch">
|
||||
|
@ -133,7 +133,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
<span class="slider round"></span>
|
||||
</label>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<label id="history_listener_enabled" style="font-weight: bold;"></label><br />
|
||||
<label class="switch">
|
||||
|
@ -141,7 +140,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
<span class="slider round"></span>
|
||||
</label>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<label id="context_menu_enabled" style="font-weight: bold;"></label><br />
|
||||
<label class="switch">
|
||||
|
@ -149,7 +147,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
<span class="slider round"></span>
|
||||
</label>
|
||||
</p>
|
||||
<br />
|
||||
<p>
|
||||
<label id="referral_marketing_enabled" style="font-weight: bold;"></label><br />
|
||||
<label class="switch">
|
||||
|
@ -157,6 +154,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
<span class="slider round"></span>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label id="ping_blocking_enabled" style="font-weight: bold;"></label><br />
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="pingBlocking">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</p>
|
||||
<br />
|
||||
<p class="text-center">
|
||||
<button type="button" id="save_settings_btn"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "ClearURLs",
|
||||
"version": "1.10.0",
|
||||
"version": "1.11.0",
|
||||
"author": "Kevin Röbert",
|
||||
"description": "Remove tracking elements from URLs.",
|
||||
"homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",
|
||||
|
|
Loading…
Reference in New Issue
Block a user