Repository navigation
Use the 'page' heuristics input for frame text - #218
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #217, which left frame-level detection unscoped.
Frame text is a whole document's
innerText, soclassifyFrameTextRegexnow callscheckHeuristicPatterns(text, 'page'), the input autoconsent's own page-level detection uses (detectHeuristicsinlib/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 byfooter-link: a "use of cookies"-style sentence that is really a cookie-policy link among short footer linesde-cookie-verb-needs-control: the German "this site uses cookies" wording without a control nearbySo 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 levelreplacesapplies 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