Version 1.6.6

#171
#195
This commit is contained in:
Kevin Röbert 2019-06-14 01:24:46 +02:00
parent f9289d9216
commit 44b0c043f8
3 changed files with 29 additions and 13 deletions

View File

@ -4,6 +4,16 @@ 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.6.6] - 2019-06-14
### Compatibility note
- Require Firefox >= 55
- Require Chrome >= 22
### Fixed
- [#171](https://gitlab.com/KevinRoebert/ClearUrls/issues/171)
- [#195](https://gitlab.com/KevinRoebert/ClearUrls/issues/195)
## [1.6.5] - 2019-06-12
### Compatibility note

View File

@ -72,14 +72,20 @@ function removeFieldsFormURL(provider, pureUrl)
};
}
if(existsFields(url)) {
fields = "?"+extractFileds(url).rmEmpty().join("&");
}
if(existsFragments(url)) {
fragments = "#"+extractFragments(url).rmEmpty().join("&");
}
/**
* Only test for matches, if there are fields or fragments that can be cleaned.
*/
if(existsFields(url) || existsFragments(url))
if(fields !== "" || fragments !== "")
{
fields = extractFileds(url).rmEmpty().join("&");
fragments = extractFragments(url).rmEmpty().join("&");
rules.forEach(function(rule) {
var beforReplace = fields;
var beforReplaceFragments = fragments;
@ -94,10 +100,10 @@ function removeFieldsFormURL(provider, pureUrl)
var tempURL = domain;
var tempBeforeURL = domain;
if(fields !== "") tempURL += "?"+fields;
if(fragments !== "") tempURL += "#"+fragments;
if(beforReplace !== "") tempBeforeURL += "?"+beforReplace;
if(beforReplaceFragments !== "") tempBeforeURL += "#"+beforReplaceFragments;
if(fields !== "") tempURL += "?"+fields.replace("?&", "?").replace("?", "");
if(fragments !== "") tempURL += "#"+fragments.replace("#&","#").replace("#", "");
if(beforReplace !== "") tempBeforeURL += "?"+beforReplace.replace("?&", "?").replace("?", "");
if(beforReplaceFragments !== "") tempBeforeURL += "#"+beforReplaceFragments.replace("#&","#").replace("#", "");
pushToLog(tempBeforeURL, tempURL, rule);
}
@ -122,10 +128,10 @@ function removeFieldsFormURL(provider, pureUrl)
var finalURL = domain;
if(fields !== "") finalURL += "?"+fields;
if(fragments !== "") finalURL += "#"+fragments;
if(fields !== "") finalURL += "?"+fields.replace("?", "");
if(fragments !== "") finalURL += "#"+fragments.replace("#", "");
url = finalURL;
url = finalURL.replace(new RegExp("\\?&"), "?").replace(new RegExp("#&"), "#");
}
if(provider.isCaneling()){
@ -363,7 +369,7 @@ function start()
* @param {boolean} isActive Is this rule active?
*/
this.addRule = function(rule, isActive = true) {
rule = "([\\/]|(&|&))*("+rule+"=[^\\/|\\?|&]*)";
rule = "([\\/|\\?|#]|(&|&))+("+rule+"=[^\\/|\\?|&]*)";
if(isActive)
{

View File

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "ClearURLs",
"version": "1.6.5",
"version": "1.6.6",
"author": "Kevin R.",
"description": "Remove tracking elements form URLs.",
"homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",