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:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user