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="FETCH">{__("Fetch")}</Option>
|
||||
<Option value="MEDIA">{__("Media")}</Option>
|
||||
<Option value="SERVICE_WORKER">{__("Service Worker")}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ function resourceTypeLabel(type: string, __: (s: string) => string): string {
|
||||
case "BEACON": return __("Beacon");
|
||||
case "FETCH": return __("Fetch");
|
||||
case "MEDIA": return __("Media");
|
||||
case "SERVICE_WORKER": return __("Service Worker");
|
||||
default: return type;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ function trackerTypeLabel(type: string, __: (s: string) => string): string {
|
||||
case "LOCAL_STORAGE": return __("localStorage");
|
||||
case "SESSION_STORAGE": return __("sessionStorage");
|
||||
case "INDEXED_DB": return __("IndexedDB");
|
||||
case "CACHE_STORAGE": return __("Cache Storage");
|
||||
default: return type;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user