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:
@@ -52,6 +52,10 @@ enum TrackerType
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeIndexedDB"
|
||||
)
|
||||
CACHE_STORAGE
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrackerTypeCacheStorage"
|
||||
)
|
||||
}
|
||||
|
||||
enum CookieBannerOrderField
|
||||
@@ -332,6 +336,10 @@ enum TrackerResourceType
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrackerResourceTypeMedia"
|
||||
)
|
||||
SERVICE_WORKER
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrackerResourceTypeServiceWorker"
|
||||
)
|
||||
}
|
||||
|
||||
enum TrackerResourceOrderField
|
||||
|
||||
@@ -423,6 +423,8 @@ func (h *Handler) handleReportDetectedTrackers(w http.ResponseWriter, r *http.Re
|
||||
storageType = coredata.TrackerTypeSessionStorage
|
||||
case "indexed_db":
|
||||
storageType = coredata.TrackerTypeIndexedDB
|
||||
case "cache_storage":
|
||||
storageType = coredata.TrackerTypeCacheStorage
|
||||
default:
|
||||
continue
|
||||
}
|
||||
@@ -457,6 +459,8 @@ func (h *Handler) handleReportDetectedTrackers(w http.ResponseWriter, r *http.Re
|
||||
resourceType = coredata.TrackerResourceTypeFetch
|
||||
case "media":
|
||||
resourceType = coredata.TrackerResourceTypeMedia
|
||||
case "service_worker":
|
||||
resourceType = coredata.TrackerResourceTypeServiceWorker
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -9450,7 +9450,7 @@ components:
|
||||
description: Cookie category ID
|
||||
tracker_type:
|
||||
type: string
|
||||
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB]
|
||||
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB, CACHE_STORAGE]
|
||||
description: Type of tracker
|
||||
pattern:
|
||||
type: string
|
||||
@@ -9522,7 +9522,7 @@ components:
|
||||
description: Cookie category ID
|
||||
resource_type:
|
||||
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
|
||||
origin:
|
||||
type: string
|
||||
@@ -10046,7 +10046,7 @@ components:
|
||||
$ref: "#/components/schemas/GID"
|
||||
tracker_type:
|
||||
type: string
|
||||
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB]
|
||||
enum: [COOKIE, LOCAL_STORAGE, SESSION_STORAGE, INDEXED_DB, CACHE_STORAGE]
|
||||
pattern:
|
||||
type: string
|
||||
match_type:
|
||||
@@ -10186,7 +10186,7 @@ components:
|
||||
$ref: "#/components/schemas/GID"
|
||||
resource_type:
|
||||
type: string
|
||||
enum: [SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH, MEDIA]
|
||||
enum: [SCRIPT, IFRAME, IMAGE, STYLESHEET, FONT, BEACON, FETCH, MEDIA, SERVICE_WORKER]
|
||||
origin:
|
||||
type: string
|
||||
path:
|
||||
|
||||
Reference in New Issue
Block a user