cookiebanner: detect service workers and Cache Storage buckets
A registered service worker is a URL-shaped artifact (origin+path of
the worker script), so it goes in tracker_resources as a new
SERVICE_WORKER resource type. A Cache Storage bucket is an opaque
named string with no URL, so it goes in detected_trackers as a new
CACHE_STORAGE tracker type.
Frontend:
- StorageDetector wraps caches.open() and enumerates caches.keys()
on start to surface pre-existing buckets that pre-date the SDK
load (service workers commonly populate caches eagerly on
install).
- ThirdPartyDetector wraps navigator.serviceWorker.register() and
enumerates getRegistrations() on start.
Both wrappers degrade silently on insecure contexts where these APIs
are unavailable.
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -170,6 +170,7 @@ export default function CookieBannerResourcesPage({
|
|||||||
<Option value="BEACON">{__("Beacon")}</Option>
|
<Option value="BEACON">{__("Beacon")}</Option>
|
||||||
<Option value="FETCH">{__("Fetch")}</Option>
|
<Option value="FETCH">{__("Fetch")}</Option>
|
||||||
<Option value="MEDIA">{__("Media")}</Option>
|
<Option value="MEDIA">{__("Media")}</Option>
|
||||||
|
<Option value="SERVICE_WORKER">{__("Service Worker")}</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ function resourceTypeLabel(type: string, __: (s: string) => string): string {
|
|||||||
case "BEACON": return __("Beacon");
|
case "BEACON": return __("Beacon");
|
||||||
case "FETCH": return __("Fetch");
|
case "FETCH": return __("Fetch");
|
||||||
case "MEDIA": return __("Media");
|
case "MEDIA": return __("Media");
|
||||||
|
case "SERVICE_WORKER": return __("Service Worker");
|
||||||
default: return type;
|
default: return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,7 @@ function trackerTypeLabel(type: string, __: (s: string) => string): string {
|
|||||||
case "LOCAL_STORAGE": return __("localStorage");
|
case "LOCAL_STORAGE": return __("localStorage");
|
||||||
case "SESSION_STORAGE": return __("sessionStorage");
|
case "SESSION_STORAGE": return __("sessionStorage");
|
||||||
case "INDEXED_DB": return __("IndexedDB");
|
case "INDEXED_DB": return __("IndexedDB");
|
||||||
|
case "CACHE_STORAGE": return __("Cache Storage");
|
||||||
default: return type;
|
default: return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,11 @@ import { getInitiatorURL } from "./initiator";
|
|||||||
|
|
||||||
interface DetectedStorageEntry {
|
interface DetectedStorageEntry {
|
||||||
key: string;
|
key: string;
|
||||||
storage_type: "local_storage" | "session_storage" | "indexed_db";
|
storage_type:
|
||||||
|
| "local_storage"
|
||||||
|
| "session_storage"
|
||||||
|
| "indexed_db"
|
||||||
|
| "cache_storage";
|
||||||
value_size: number | null;
|
value_size: number | null;
|
||||||
initiator_url?: string;
|
initiator_url?: string;
|
||||||
}
|
}
|
||||||
@@ -42,6 +46,7 @@ export class StorageDetector implements Detector {
|
|||||||
private timer: ReturnType<typeof setTimeout> | null = null;
|
private timer: ReturnType<typeof setTimeout> | null = null;
|
||||||
private originalSetItem: typeof Storage.prototype.setItem | null = null;
|
private originalSetItem: typeof Storage.prototype.setItem | null = null;
|
||||||
private originalIDBOpen: typeof IDBFactory.prototype.open | null = null;
|
private originalIDBOpen: typeof IDBFactory.prototype.open | null = null;
|
||||||
|
private originalCachesOpen: typeof CacheStorage.prototype.open | null = null;
|
||||||
|
|
||||||
constructor(baseUrl: URL, bannerId: string) {
|
constructor(baseUrl: URL, bannerId: string) {
|
||||||
this.reportUrl = new URL(`${bannerId}/report`, baseUrl);
|
this.reportUrl = new URL(`${bannerId}/report`, baseUrl);
|
||||||
@@ -51,7 +56,9 @@ export class StorageDetector implements Detector {
|
|||||||
start(): void {
|
start(): void {
|
||||||
this.wrapStorage();
|
this.wrapStorage();
|
||||||
this.wrapIndexedDB();
|
this.wrapIndexedDB();
|
||||||
|
this.wrapCacheStorage();
|
||||||
this.scanExisting();
|
this.scanExisting();
|
||||||
|
this.scanCacheStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(): void {
|
stop(): void {
|
||||||
@@ -72,6 +79,10 @@ export class StorageDetector implements Detector {
|
|||||||
IDBFactory.prototype.open = this.originalIDBOpen;
|
IDBFactory.prototype.open = this.originalIDBOpen;
|
||||||
this.originalIDBOpen = null;
|
this.originalIDBOpen = null;
|
||||||
}
|
}
|
||||||
|
if (this.originalCachesOpen && typeof caches !== "undefined") {
|
||||||
|
caches.open = this.originalCachesOpen;
|
||||||
|
this.originalCachesOpen = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private wrapStorage(): void {
|
private wrapStorage(): void {
|
||||||
@@ -107,6 +118,20 @@ export class StorageDetector implements Detector {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private wrapCacheStorage(): void {
|
||||||
|
if (typeof caches === "undefined") return;
|
||||||
|
|
||||||
|
const originalOpen = caches.open.bind(caches);
|
||||||
|
this.originalCachesOpen = originalOpen;
|
||||||
|
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
caches.open = function (name: string): Promise<Cache> {
|
||||||
|
self.onCacheStorageOpen(name);
|
||||||
|
return originalOpen(name);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
private onStorageWrite(
|
private onStorageWrite(
|
||||||
key: string,
|
key: string,
|
||||||
value: string,
|
value: string,
|
||||||
@@ -143,6 +168,37 @@ export class StorageDetector implements Detector {
|
|||||||
this.scheduleFlush();
|
this.scheduleFlush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private onCacheStorageOpen(name: string): void {
|
||||||
|
const reportKey = `cache_storage:${name}`;
|
||||||
|
if (this.reported.has(reportKey)) return;
|
||||||
|
|
||||||
|
this.reported.add(reportKey);
|
||||||
|
this.pending.set(reportKey, {
|
||||||
|
key: name,
|
||||||
|
storage_type: "cache_storage",
|
||||||
|
value_size: null,
|
||||||
|
});
|
||||||
|
this.scheduleFlush();
|
||||||
|
}
|
||||||
|
|
||||||
|
// scanCacheStorage enumerates pre-existing cache buckets created
|
||||||
|
// before the SDK loaded. Service workers commonly create their
|
||||||
|
// caches eagerly on `install`, so without this scan we would miss
|
||||||
|
// any cache bucket whose creation predates the banner script.
|
||||||
|
private scanCacheStorage(): void {
|
||||||
|
if (typeof caches === "undefined") return;
|
||||||
|
caches
|
||||||
|
.keys()
|
||||||
|
.then((names) => {
|
||||||
|
for (const name of names) {
|
||||||
|
this.onCacheStorageOpen(name);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// Insecure context or storage partition errors -- ignore.
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private scanExisting(): void {
|
private scanExisting(): void {
|
||||||
this.scanStorage(localStorage, "local_storage");
|
this.scanStorage(localStorage, "local_storage");
|
||||||
this.scanStorage(sessionStorage, "session_storage");
|
this.scanStorage(sessionStorage, "session_storage");
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ type ResourceType =
|
|||||||
| "font"
|
| "font"
|
||||||
| "beacon"
|
| "beacon"
|
||||||
| "fetch"
|
| "fetch"
|
||||||
| "media";
|
| "media"
|
||||||
|
| "service_worker";
|
||||||
|
|
||||||
interface DetectedResourceEntry {
|
interface DetectedResourceEntry {
|
||||||
url: string;
|
url: string;
|
||||||
@@ -80,6 +81,7 @@ export class ThirdPartyDetector implements Detector {
|
|||||||
private timer: ReturnType<typeof setTimeout> | null = null;
|
private timer: ReturnType<typeof setTimeout> | null = null;
|
||||||
private observer: MutationObserver | null = null;
|
private observer: MutationObserver | null = null;
|
||||||
private perfObserver: PerformanceObserver | null = null;
|
private perfObserver: PerformanceObserver | null = null;
|
||||||
|
private originalSWRegister: typeof ServiceWorkerContainer.prototype.register | null = null;
|
||||||
|
|
||||||
constructor(baseUrl: URL, bannerId: string) {
|
constructor(baseUrl: URL, bannerId: string) {
|
||||||
this.reportUrl = new URL(`${bannerId}/report`, baseUrl);
|
this.reportUrl = new URL(`${bannerId}/report`, baseUrl);
|
||||||
@@ -91,6 +93,8 @@ export class ThirdPartyDetector implements Detector {
|
|||||||
this.scanExisting();
|
this.scanExisting();
|
||||||
this.observeMutations();
|
this.observeMutations();
|
||||||
this.observePerformance();
|
this.observePerformance();
|
||||||
|
this.wrapServiceWorker();
|
||||||
|
this.scanServiceWorkers();
|
||||||
}
|
}
|
||||||
|
|
||||||
stop(): void {
|
stop(): void {
|
||||||
@@ -112,6 +116,15 @@ export class ThirdPartyDetector implements Detector {
|
|||||||
this.perfObserver.disconnect();
|
this.perfObserver.disconnect();
|
||||||
this.perfObserver = null;
|
this.perfObserver = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.originalSWRegister
|
||||||
|
&& typeof navigator !== "undefined"
|
||||||
|
&& navigator.serviceWorker
|
||||||
|
) {
|
||||||
|
navigator.serviceWorker.register = this.originalSWRegister;
|
||||||
|
this.originalSWRegister = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private scanExisting(): void {
|
private scanExisting(): void {
|
||||||
@@ -179,6 +192,50 @@ export class ThirdPartyDetector implements Detector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wrapServiceWorker intercepts navigator.serviceWorker.register so
|
||||||
|
// each registration -- even ones initiated by third-party SDKs --
|
||||||
|
// surfaces as a tracker_resource entry keyed on the worker script
|
||||||
|
// origin+path.
|
||||||
|
private wrapServiceWorker(): void {
|
||||||
|
if (typeof navigator === "undefined" || !navigator.serviceWorker) return;
|
||||||
|
|
||||||
|
const sw = navigator.serviceWorker;
|
||||||
|
const originalRegister = sw.register.bind(sw);
|
||||||
|
this.originalSWRegister = originalRegister;
|
||||||
|
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
sw.register = function (
|
||||||
|
scriptURL: string | URL,
|
||||||
|
options?: RegistrationOptions,
|
||||||
|
): Promise<ServiceWorkerRegistration> {
|
||||||
|
const url = typeof scriptURL === "string" ? scriptURL : scriptURL.toString();
|
||||||
|
self.processResource(url, "service_worker");
|
||||||
|
return originalRegister(scriptURL, options);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// scanServiceWorkers enumerates registrations that pre-date the SDK
|
||||||
|
// (e.g. installed on a previous visit, restored from cache).
|
||||||
|
private scanServiceWorkers(): void {
|
||||||
|
if (typeof navigator === "undefined" || !navigator.serviceWorker) return;
|
||||||
|
|
||||||
|
navigator.serviceWorker
|
||||||
|
.getRegistrations()
|
||||||
|
.then((registrations) => {
|
||||||
|
for (const r of registrations) {
|
||||||
|
const url
|
||||||
|
= r.active?.scriptURL
|
||||||
|
?? r.installing?.scriptURL
|
||||||
|
?? r.waiting?.scriptURL;
|
||||||
|
if (url) this.processResource(url, "service_worker");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
// Some browsers throw NotSupportedError in insecure contexts.
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private processResource(src: string, resourceType: ResourceType): void {
|
private processResource(src: string, resourceType: ResourceType): void {
|
||||||
if (EXTENSION_URL_RE.test(src)) return;
|
if (EXTENSION_URL_RE.test(src)) return;
|
||||||
|
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
|||||||
huh.NewOption("Beacon", "BEACON"),
|
huh.NewOption("Beacon", "BEACON"),
|
||||||
huh.NewOption("Fetch / XHR", "FETCH"),
|
huh.NewOption("Fetch / XHR", "FETCH"),
|
||||||
huh.NewOption("Media", "MEDIA"),
|
huh.NewOption("Media", "MEDIA"),
|
||||||
|
huh.NewOption("Service Worker", "SERVICE_WORKER"),
|
||||||
).
|
).
|
||||||
Value(&flagResourceType).Run(); err != nil {
|
Value(&flagResourceType).Run(); err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -161,7 +162,7 @@ func NewCmdCreate(f *cmdutil.Factory) *cobra.Command {
|
|||||||
|
|
||||||
cmd.Flags().StringVar(&flagCategoryID, "category-id", "", "Cookie category ID (required)")
|
cmd.Flags().StringVar(&flagCategoryID, "category-id", "", "Cookie category ID (required)")
|
||||||
_ = cmd.MarkFlagRequired("category-id")
|
_ = cmd.MarkFlagRequired("category-id")
|
||||||
cmd.Flags().StringVar(&flagResourceType, "resource-type", "", "Resource type: SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH or MEDIA (required)")
|
cmd.Flags().StringVar(&flagResourceType, "resource-type", "", "Resource type: SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH, MEDIA or SERVICE_WORKER (required)")
|
||||||
cmd.Flags().StringVar(&flagOrigin, "origin", "", "Origin URL (required)")
|
cmd.Flags().StringVar(&flagOrigin, "origin", "", "Origin URL (required)")
|
||||||
cmd.Flags().StringVar(&flagPath, "path", "", "Resource path (required)")
|
cmd.Flags().StringVar(&flagPath, "path", "", "Resource path (required)")
|
||||||
cmd.Flags().StringVar(&flagDisplayName, "display-name", "", "Display name (required)")
|
cmd.Flags().StringVar(&flagDisplayName, "display-name", "", "Display name (required)")
|
||||||
|
|||||||
21
pkg/coredata/migrations/20260511T064746Z.sql
Normal file
21
pkg/coredata/migrations/20260511T064746Z.sql
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
-- Copyright (c) 2026 Probo Inc <hello@getprobo.com>.
|
||||||
|
--
|
||||||
|
-- Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
-- purpose with or without fee is hereby granted, provided that the above
|
||||||
|
-- copyright notice and this permission notice appear in all copies.
|
||||||
|
--
|
||||||
|
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
-- PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
-- A registered service worker is a URL-shaped artifact, so it lives
|
||||||
|
-- in tracker_resources alongside scripts/iframes.
|
||||||
|
ALTER TYPE tracker_resource_type ADD VALUE IF NOT EXISTS 'SERVICE_WORKER';
|
||||||
|
|
||||||
|
-- A Cache Storage bucket is just a named string identifier with no
|
||||||
|
-- URL, so it lives in detected_trackers like the other storage types.
|
||||||
|
ALTER TYPE tracker_type ADD VALUE IF NOT EXISTS 'CACHE_STORAGE';
|
||||||
@@ -30,6 +30,7 @@ const (
|
|||||||
TrackerResourceTypeBeacon TrackerResourceType = "BEACON"
|
TrackerResourceTypeBeacon TrackerResourceType = "BEACON"
|
||||||
TrackerResourceTypeFetch TrackerResourceType = "FETCH"
|
TrackerResourceTypeFetch TrackerResourceType = "FETCH"
|
||||||
TrackerResourceTypeMedia TrackerResourceType = "MEDIA"
|
TrackerResourceTypeMedia TrackerResourceType = "MEDIA"
|
||||||
|
TrackerResourceTypeServiceWorker TrackerResourceType = "SERVICE_WORKER"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TrackerResourceTypes() []TrackerResourceType {
|
func TrackerResourceTypes() []TrackerResourceType {
|
||||||
@@ -42,6 +43,7 @@ func TrackerResourceTypes() []TrackerResourceType {
|
|||||||
TrackerResourceTypeBeacon,
|
TrackerResourceTypeBeacon,
|
||||||
TrackerResourceTypeFetch,
|
TrackerResourceTypeFetch,
|
||||||
TrackerResourceTypeMedia,
|
TrackerResourceTypeMedia,
|
||||||
|
TrackerResourceTypeServiceWorker,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,6 +79,8 @@ func (s *TrackerResourceType) Scan(value any) error {
|
|||||||
*s = TrackerResourceTypeFetch
|
*s = TrackerResourceTypeFetch
|
||||||
case TrackerResourceTypeMedia:
|
case TrackerResourceTypeMedia:
|
||||||
*s = TrackerResourceTypeMedia
|
*s = TrackerResourceTypeMedia
|
||||||
|
case TrackerResourceTypeServiceWorker:
|
||||||
|
*s = TrackerResourceTypeServiceWorker
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid TrackerResourceType value: %q", v)
|
return fmt.Errorf("invalid TrackerResourceType value: %q", v)
|
||||||
}
|
}
|
||||||
@@ -92,7 +96,8 @@ func (s TrackerResourceType) Value() (driver.Value, error) {
|
|||||||
TrackerResourceTypeFont,
|
TrackerResourceTypeFont,
|
||||||
TrackerResourceTypeBeacon,
|
TrackerResourceTypeBeacon,
|
||||||
TrackerResourceTypeFetch,
|
TrackerResourceTypeFetch,
|
||||||
TrackerResourceTypeMedia:
|
TrackerResourceTypeMedia,
|
||||||
|
TrackerResourceTypeServiceWorker:
|
||||||
return string(s), nil
|
return string(s), nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("invalid TrackerResourceType: %s", s)
|
return nil, fmt.Errorf("invalid TrackerResourceType: %s", s)
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ const (
|
|||||||
TrackerTypeLocalStorage TrackerType = "LOCAL_STORAGE"
|
TrackerTypeLocalStorage TrackerType = "LOCAL_STORAGE"
|
||||||
TrackerTypeSessionStorage TrackerType = "SESSION_STORAGE"
|
TrackerTypeSessionStorage TrackerType = "SESSION_STORAGE"
|
||||||
TrackerTypeIndexedDB TrackerType = "INDEXED_DB"
|
TrackerTypeIndexedDB TrackerType = "INDEXED_DB"
|
||||||
|
TrackerTypeCacheStorage TrackerType = "CACHE_STORAGE"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TrackerTypes() []TrackerType {
|
func TrackerTypes() []TrackerType {
|
||||||
@@ -34,6 +35,7 @@ func TrackerTypes() []TrackerType {
|
|||||||
TrackerTypeLocalStorage,
|
TrackerTypeLocalStorage,
|
||||||
TrackerTypeSessionStorage,
|
TrackerTypeSessionStorage,
|
||||||
TrackerTypeIndexedDB,
|
TrackerTypeIndexedDB,
|
||||||
|
TrackerTypeCacheStorage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,6 +63,8 @@ func (s *TrackerType) Scan(value any) error {
|
|||||||
*s = TrackerTypeSessionStorage
|
*s = TrackerTypeSessionStorage
|
||||||
case TrackerTypeIndexedDB:
|
case TrackerTypeIndexedDB:
|
||||||
*s = TrackerTypeIndexedDB
|
*s = TrackerTypeIndexedDB
|
||||||
|
case TrackerTypeCacheStorage:
|
||||||
|
*s = TrackerTypeCacheStorage
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid TrackerType value: %q", v)
|
return fmt.Errorf("invalid TrackerType value: %q", v)
|
||||||
}
|
}
|
||||||
@@ -72,7 +76,8 @@ func (s TrackerType) Value() (driver.Value, error) {
|
|||||||
case TrackerTypeCookie,
|
case TrackerTypeCookie,
|
||||||
TrackerTypeLocalStorage,
|
TrackerTypeLocalStorage,
|
||||||
TrackerTypeSessionStorage,
|
TrackerTypeSessionStorage,
|
||||||
TrackerTypeIndexedDB:
|
TrackerTypeIndexedDB,
|
||||||
|
TrackerTypeCacheStorage:
|
||||||
return string(s), nil
|
return string(s), nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("invalid TrackerType: %s", s)
|
return nil, fmt.Errorf("invalid TrackerType: %s", s)
|
||||||
|
|||||||
@@ -52,6 +52,10 @@ enum TrackerType
|
|||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeIndexedDB"
|
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeIndexedDB"
|
||||||
)
|
)
|
||||||
|
CACHE_STORAGE
|
||||||
|
@goEnum(
|
||||||
|
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeCacheStorage"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CookieBannerOrderField
|
enum CookieBannerOrderField
|
||||||
@@ -332,6 +336,10 @@ enum TrackerResourceType
|
|||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrackerResourceTypeMedia"
|
value: "go.probo.inc/probo/pkg/coredata.TrackerResourceTypeMedia"
|
||||||
)
|
)
|
||||||
|
SERVICE_WORKER
|
||||||
|
@goEnum(
|
||||||
|
value: "go.probo.inc/probo/pkg/coredata.TrackerResourceTypeServiceWorker"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrackerResourceOrderField
|
enum TrackerResourceOrderField
|
||||||
|
|||||||
@@ -423,6 +423,8 @@ func (h *Handler) handleReportDetectedTrackers(w http.ResponseWriter, r *http.Re
|
|||||||
storageType = coredata.TrackerTypeSessionStorage
|
storageType = coredata.TrackerTypeSessionStorage
|
||||||
case "indexed_db":
|
case "indexed_db":
|
||||||
storageType = coredata.TrackerTypeIndexedDB
|
storageType = coredata.TrackerTypeIndexedDB
|
||||||
|
case "cache_storage":
|
||||||
|
storageType = coredata.TrackerTypeCacheStorage
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -457,6 +459,8 @@ func (h *Handler) handleReportDetectedTrackers(w http.ResponseWriter, r *http.Re
|
|||||||
resourceType = coredata.TrackerResourceTypeFetch
|
resourceType = coredata.TrackerResourceTypeFetch
|
||||||
case "media":
|
case "media":
|
||||||
resourceType = coredata.TrackerResourceTypeMedia
|
resourceType = coredata.TrackerResourceTypeMedia
|
||||||
|
case "service_worker":
|
||||||
|
resourceType = coredata.TrackerResourceTypeServiceWorker
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9450,7 +9450,7 @@ components:
|
|||||||
description: Cookie category ID
|
description: Cookie category ID
|
||||||
tracker_type:
|
tracker_type:
|
||||||
type: string
|
type: string
|
||||||
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB]
|
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB, CACHE_STORAGE]
|
||||||
description: Type of tracker
|
description: Type of tracker
|
||||||
pattern:
|
pattern:
|
||||||
type: string
|
type: string
|
||||||
@@ -9522,7 +9522,7 @@ components:
|
|||||||
description: Cookie category ID
|
description: Cookie category ID
|
||||||
resource_type:
|
resource_type:
|
||||||
type: string
|
type: string
|
||||||
enum: [SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH, MEDIA]
|
enum: [SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH, MEDIA, SERVICE_WORKER]
|
||||||
description: Type of tracked resource
|
description: Type of tracked resource
|
||||||
origin:
|
origin:
|
||||||
type: string
|
type: string
|
||||||
@@ -10046,7 +10046,7 @@ components:
|
|||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
tracker_type:
|
tracker_type:
|
||||||
type: string
|
type: string
|
||||||
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB]
|
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB, CACHE_STORAGE]
|
||||||
pattern:
|
pattern:
|
||||||
type: string
|
type: string
|
||||||
match_type:
|
match_type:
|
||||||
@@ -10186,7 +10186,7 @@ components:
|
|||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
resource_type:
|
resource_type:
|
||||||
type: string
|
type: string
|
||||||
enum: [SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH, MEDIA]
|
enum: [SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH, MEDIA, SERVICE_WORKER]
|
||||||
origin:
|
origin:
|
||||||
type: string
|
type: string
|
||||||
path:
|
path:
|
||||||
|
|||||||
Reference in New Issue
Block a user