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

Function urlWithoutParamsAndHash

core_js/tools.js:134–146  ·  view source on GitHub ↗

* Returns the given URL without searchParams and hash. * @param {URL} url the URL as object * @return {URL} the url without searchParams and hash

(url)

Source from the content-addressed store, hash-verified

132 * @return {URL} the url without searchParams and hash
133 */
134function urlWithoutParamsAndHash(url) {
135 let newURL = url.toString();
136
137 if (url.search) {
138 newURL = newURL.replace(url.search, "");
139 }
140
141 if (url.hash) {
142 newURL = newURL.replace(url.hash, "");
143 }
144
145 return new URL(newURL);
146}
147
148/**
149 * Load local saved data, if the browser is offline or

Callers 1

removeFieldsFormURLFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected