From 1c3ce56b48923772d1e4156561739f29662502ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Fri, 22 May 2026 18:04:17 +0200 Subject: [PATCH] Mark page-world extension writes with EXTENSION source MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous cleanup deleted every isExtensionCaller() site, including the one in cookie/storage detectors that did fire reliably for the residual case: page-world extensions (MV3 main world, userscripts with @grant none) whose stack contains a chrome-/moz-/safari-web-extension frame at the synchronous write. Recover that signal for free by returning fromExtension from getInitiatorURL (it already walks the stack and discards extension frames via continue), and have the cookie and storage detectors report source: "extension" instead of "script" when the flag is set. End-to-end plumbing reuses the existing source column: extend the cookie_source Postgres enum with EXTENSION, add the CookieSourceExtension constant with a doc block describing each bucket's actual semantics, add the handler.go switch cases, expose EXTENSION on the GraphQL and MCP CookieSource enums, and add the Extension option to the console source filter. Update bestSource in the pattern analysis worker so a glob merging only extension-attributed exact patterns is no longer silently rolled up to PRE_EXISTING. New precedence is SCRIPT > EXTENSION > PRE_EXISTING, matching the upsert SQL's "page-script wins" rule and the asymmetric signal strength of each bucket. Out of scope: any behavioural use of EXTENSION (auto-exclusion, denylist classification, dashboard surfacing) -- that belongs in the follow-up backend denylist plan. Signed-off-by: Émile Ré --- .../trackers/CookieBannerTrackersPage.tsx | 1 + .../src/detectors/cookie-detector.ts | 4 +- .../cookie-banner/src/detectors/initiator.ts | 48 +++++++++++++------ .../src/detectors/storage-detector.ts | 11 +++-- packages/cookie-banner/src/detectors/types.ts | 4 +- pkg/cookiebanner/pattern_analysis_worker.go | 27 ++++++++++- pkg/coredata/cookie_source.go | 37 +++++++++++++- pkg/coredata/migrations/20260522T155558Z.sql | 15 ++++++ .../console/v1/graphql/cookie_banner.graphql | 4 ++ pkg/server/api/cookiebanner/v1/handler.go | 4 ++ pkg/server/api/mcp/v1/specification.yaml | 2 +- 11 files changed, 130 insertions(+), 27 deletions(-) create mode 100644 pkg/coredata/migrations/20260522T155558Z.sql diff --git a/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/CookieBannerTrackersPage.tsx b/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/CookieBannerTrackersPage.tsx index c2eb96608..8fe92694b 100644 --- a/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/CookieBannerTrackersPage.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/configuration/trackers/CookieBannerTrackersPage.tsx @@ -209,6 +209,7 @@ export default function CookieBannerTrackersPage({ +