cookie-banner: rename ThirdPartyDetector to ResourceDetector

The detector emits tracker_resource entries (scripts, iframes, images,
beacons, fonts, fetches, media, service workers); the "third-party"
qualifier was misleading because the same code path also fires for
service workers, which are always same-origin per browser security
rules. Rename the class and file to match what they actually produce.

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-11 13:07:30 +04:00
parent bec0254597
commit 438ca439de
3 changed files with 4 additions and 4 deletions

View File

@@ -18,7 +18,7 @@ import {
} from "./activation";
import { COOKIE_NAME, getConsentCookie, setConsentCookie } from "./cookie";
import type { Detector } from "./detectors";
import { CookieDetector, ReportQueue, StorageDetector, ThirdPartyDetector } from "./detectors";
import { CookieDetector, ReportQueue, ResourceDetector, StorageDetector } from "./detectors";
import { NotFoundError } from "./errors";
import { fetchJSON } from "./http";
import { detectLanguage } from "./i18n";
@@ -316,7 +316,7 @@ export class CookieBannerClient {
this.detectors = [
new CookieDetector(this.reportQueue, apiOrigin, knownNames),
new StorageDetector(this.reportQueue, apiOrigin),
new ThirdPartyDetector(this.reportQueue, apiOrigin),
new ResourceDetector(this.reportQueue, apiOrigin),
];
for (const d of this.detectors) {

View File

@@ -15,7 +15,7 @@
export type { Detector } from "./detector";
export { CookieDetector } from "./cookie-detector";
export { StorageDetector } from "./storage-detector";
export { ThirdPartyDetector } from "./third-party-detector";
export { ResourceDetector } from "./resource-detector";
export { ReportQueue } from "./report-queue";
export type {
CookieSource,

View File

@@ -54,7 +54,7 @@ function mapInitiatorType(it: string): ResourceType | null {
}
}
export class ThirdPartyDetector implements Detector {
export class ResourceDetector implements Detector {
private readonly queue: ReportQueue;
private readonly pageOrigin: string;
private readonly apiOrigin: string;