(requestUrl)
| 424 | }; |
| 425 | |
| 426 | const isTrackingRequest = function (requestUrl) { |
| 427 | if (typeof requestUrl !== "string" || requestUrl.trim() === "") { |
| 428 | return false; |
| 429 | } |
| 430 | if (trackingBlockRegex.test(requestUrl)) { |
| 431 | return true; |
| 432 | } |
| 433 | const parsedUrl = parseRequestUrl(requestUrl); |
| 434 | if (!parsedUrl) { |
| 435 | return false; |
| 436 | } |
| 437 | return ( |
| 438 | trackingHostRegex.test(parsedUrl.hostname) || |
| 439 | trackingPathRegex.test(`${parsedUrl.pathname}${parsedUrl.search}`) |
| 440 | ); |
| 441 | }; |
| 442 | |
| 443 | const buildBlockedTrackingResponse = function () { |
| 444 | return new Response(null, { |
no test coverage detected