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

Function checkLocalURL

core_js/tools.js:98–109  ·  view source on GitHub ↗

* Returns true if the url has a local host. * @param {URL} url URL as object * @return {boolean}

(url)

Source from the content-addressed store, hash-verified

96 * @return {boolean}
97 */
98function checkLocalURL(url) {
99 let host = extractHost(url);
100
101 if (!host.match(/^\d/) && host !== 'localhost') {
102 return false;
103 }
104
105 return ipRangeCheck(host, ["10.0.0.0/8", "172.16.0.0/12",
106 "192.168.0.0/16", "100.64.0.0/10",
107 "169.254.0.0/16", "127.0.0.1"]) ||
108 host === 'localhost';
109}
110
111/**
112 * Return the number of parameters query strings.

Callers 2

removeFieldsFormURLFunction · 0.85
eTagFilterFunction · 0.85

Calls 1

extractHostFunction · 0.85

Tested by

no test coverage detected