Preparations for costume rules

+ Preparations for costume rules
- Feature "Report URLs"
+ Auto hash rules
+ Minimize rules length
+ Add start and end delimiters to rules
This commit is contained in:
Kevin Röbert
2019-03-12 18:13:23 +01:00
parent 81bc71de5e
commit 9c638c52f9
10 changed files with 541 additions and 140 deletions

View File

@@ -53,10 +53,17 @@ function checkOSAndroid()
*/
function countFields(url)
{
var matches = (url.match(/[^\/|\?|&]+=[^\/|\?|&]+/gi) || []);
var count = matches.length;
return extractFileds(url).length;
}
return count;
/**
* Extract the fields from an url.
* @param {String} url URL as String
* @return {Array} Fields as array
*/
function extractFileds(url)
{
return (url.match(/[^\/|\?|&]+=[^\/|\?|&]+/gi) || []);
}
/**