Fix #153
Implementing the flat function by my own, also a function that removes empty fields from arrays.
This commit is contained in:
parent
f69ae79adb
commit
869cd63e64
|
@ -423,7 +423,7 @@ function start()
|
|||
//Log the action
|
||||
if(storage.loggingStatus)
|
||||
{
|
||||
pushToLog(domain+beforReplace, domain+"?"+extractFileds(fields).flat().join("&"), rule);
|
||||
pushToLog(domain+beforReplace, domain+"?"+extractFileds(fields).rmEmpty().join("&"), rule);
|
||||
}
|
||||
|
||||
if(badges[tabid] == null) badges[tabid] = 0;
|
||||
|
@ -444,7 +444,7 @@ function start()
|
|||
}
|
||||
});
|
||||
|
||||
var finalFields = extractFileds(fields).flat();
|
||||
var finalFields = extractFileds(fields).rmEmpty();
|
||||
if(finalFields.length > 0)
|
||||
{
|
||||
url = domain+"?"+finalFields.join("&");
|
||||
|
|
|
@ -21,6 +21,20 @@
|
|||
* This script is responsible for some tools.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To support Waterfox.
|
||||
*/
|
||||
Array.prototype.rmEmpty = function() {
|
||||
return this.filter(v => v);
|
||||
};
|
||||
|
||||
/*
|
||||
* To support Waterfox.
|
||||
*/
|
||||
Array.prototype.flatten = function() {
|
||||
return this.reduce((a, b) => a.concat(b), []);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if an object is empty.
|
||||
* @param {Object} obj
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"manifest_version": 2,
|
||||
"name": "ClearURLs",
|
||||
"version": "1.5.1.5a",
|
||||
"version": "1.5.1.6a",
|
||||
"author": "Kevin R.",
|
||||
"description": "Remove tracking elements form URLs.",
|
||||
"homepage_url": "https://gitlab.com/KevinRoebert/ClearUrls",
|
||||
|
|
Loading…
Reference in New Issue
Block a user