Skip to content

Use the 'page' heuristics input for frame text - #218

Merged
muodov merged 1 commit into
mainfrom
claude/frame-page-heuristics
Nov 10, 2026
Merged

muodov merged 1 commit into
mainfrom
claude/frame-page-heuristics

Conversation

@sammacbeth

Copy link
Copy Markdown
Collaborator

Description

Follow-up to #217, which left frame-level detection unscoped.

Frame text is a whole document's innerText, so classifyFrameTextRegex now calls checkHeuristicPatterns(text, 'page'), the input autoconsent's own page-level detection uses (detectHeuristics in lib/web.ts).

In autoconsent 18, a call without an input doesn't behave as in 17.x. It applies the unscoped patterns and negatives but skips the page-scoped negatives written for whole-document text:

  • age-gate: age wording near a match, unless the notice has its own control close by
  • footer-link: a "use of cookies"-style sentence that is really a cookie-policy link among short footer lines
  • de-cookie-verb-needs-control: the German "this site uses cookies" wording without a control nearby

So frames got the 18.x patterns without the negatives that keep them from matching footers and age gates. Frame results will shift with this change, in the same direction autoconsent's page detection already went.

Steps to test this PR

  • npm test: lint and 50 passing.
  • drops age gates at popup level and next to them at page level replaces applies the popup exclusions only at popup level. It checks that an age gate is dropped at both levels, and that the same text followed by its own Accept/Reject controls still counts as a frame-level match.

🤖 Generated with Claude Code

Frame text is a whole document's innerText, so classifyFrameTextRegex now
passes 'page' to checkHeuristicPatterns, as autoconsent's own page-level
detection does. Without an input, the page-scoped negatives (age gate,
cookie-policy footer link, German cookie verb without a control) were
skipped for frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sammacbeth
sammacbeth requested a review from muodov November 10, 2026 13:47

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@muodov
muodov merged commit 2da46b8 into main Nov 10, 2026
5 checks passed
@muodov
muodov deleted the claude/frame-page-heuristics branch November 10, 2026 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants