MCPcopy Index your code
hub / github.com/ClearURLs/Addon / _cleaning

Function _cleaning

core_js/pureCleaning.js:43–71  ·  view source on GitHub ↗

* Internal function to clean the given URL.

(url, quiet = false)

Source from the content-addressed store, hash-verified

41 * Internal function to clean the given URL.
42 */
43function _cleaning(url, quiet = false) {
44 let cleanURL = url;
45 const URLbeforeReplaceCount = countFields(url);
46
47 if (!quiet) {
48 //Add Fields form Request to global url counter
49 increaseTotalCounter(URLbeforeReplaceCount);
50 }
51
52 for (let i = 0; i < providers.length; i++) {
53 let result = {
54 "changes": false,
55 "url": "",
56 "redirect": false,
57 "cancel": false
58 };
59
60 if (providers[i].matchURL(cleanURL)) {
61 result = removeFieldsFormURL(providers[i], cleanURL, quiet);
62 cleanURL = result.url;
63 }
64
65 if (result.redirect) {
66 return result.url;
67 }
68 }
69
70 return cleanURL;
71}

Callers 1

pureCleaningFunction · 0.85

Calls 3

countFieldsFunction · 0.85
increaseTotalCounterFunction · 0.85
removeFieldsFormURLFunction · 0.85

Tested by

no test coverage detected