parent
f9289d9216
commit
44b0c043f8
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -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/),
|
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).
|
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
|
## [1.6.5] - 2019-06-12
|
||||||
|
|
||||||
### Compatibility note
|
### Compatibility note
|
||||||
|
|
30
clearurls.js
30
clearurls.js
|
@ -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.
|
* 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) {
|
rules.forEach(function(rule) {
|
||||||
var beforReplace = fields;
|
var beforReplace = fields;
|
||||||
var beforReplaceFragments = fragments;
|
var beforReplaceFragments = fragments;
|
||||||
|
@ -94,10 +100,10 @@ function removeFieldsFormURL(provider, pureUrl)
|
||||||
var tempURL = domain;
|
var tempURL = domain;
|
||||||
var tempBeforeURL = domain;
|
var tempBeforeURL = domain;
|
||||||
|
|
||||||
if(fields !== "") tempURL += "?"+fields;
|
if(fields !== "") tempURL += "?"+fields.replace("?&", "?").replace("?", "");
|
||||||
if(fragments !== "") tempURL += "#"+fragments;
|
if(fragments !== "") tempURL += "#"+fragments.replace("#&","#").replace("#", "");
|
||||||
if(beforReplace !== "") tempBeforeURL += "?"+beforReplace;
|
if(beforReplace !== "") tempBeforeURL += "?"+beforReplace.replace("?&", "?").replace("?", "");
|
||||||
if(beforReplaceFragments !== "") tempBeforeURL += "#"+beforReplaceFragments;
|
if(beforReplaceFragments !== "") tempBeforeURL += "#"+beforReplaceFragments.replace("#&","#").replace("#", "");
|
||||||
|
|
||||||
pushToLog(tempBeforeURL, tempURL, rule);
|
pushToLog(tempBeforeURL, tempURL, rule);
|
||||||
}
|
}
|
||||||
|
@ -122,10 +128,10 @@ function removeFieldsFormURL(provider, pureUrl)
|
||||||
|
|
||||||
var finalURL = domain;
|
var finalURL = domain;
|
||||||
|
|
||||||
if(fields !== "") finalURL += "?"+fields;
|
if(fields !== "") finalURL += "?"+fields.replace("?", "");
|
||||||
if(fragments !== "") finalURL += "#"+fragments;
|
if(fragments !== "") finalURL += "#"+fragments.replace("#", "");
|
||||||
|
|
||||||
url = finalURL;
|
url = finalURL.replace(new RegExp("\\?&"), "?").replace(new RegExp("#&"), "#");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(provider.isCaneling()){
|
if(provider.isCaneling()){
|
||||||
|
@ -363,7 +369,7 @@ function start()
|
||||||
* @param {boolean} isActive Is this rule active?
|
* @param {boolean} isActive Is this rule active?
|
||||||
*/
|
*/
|
||||||
this.addRule = function(rule, isActive = true) {
|
this.addRule = function(rule, isActive = true) {
|
||||||
rule = "([\\/]|(&|&))*("+rule+"=[^\\/|\\?|&]*)";
|
rule = "([\\/|\\?|#]|(&|&))+("+rule+"=[^\\/|\\?|&]*)";
|
||||||
|
|
||||||
if(isActive)
|
if(isActive)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "ClearURLs",
|
"name": "ClearURLs",
|
||||||
"version": "1.6.5",
|
"version": "1.6.6",
|
||||||
"author": "Kevin R.",
|
"author": "Kevin R.",
|
||||||
"description": "Remove tracking elements form URLs.",
|
"description": "Remove tracking elements form URLs.",
|
||||||
"homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",
|
"homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user