Repository navigation
feat(import): use element boxes of the imported site in the layout shift model - #569
Merged
Merged
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://feature-173-import-element-boxes.fontstay.dev (commit cf2f47e)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
fogrew
force-pushed
the
feature/173-import-element-boxes
branch
from
November 10, 2026 04:53
1dac022 to
9c2a170
Compare
…ift model (#173) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…h boxes (#173) Skip navigation chrome in the collector, clamp spacing, send the capture viewport width. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…es (#173) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
fogrew
force-pushed
the
feature/173-import-element-boxes
branch
from
November 10, 2026 05:07
9c2a170 to
cf2f47e
Compare
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.
Closes #173
The bookmarklet and the extension now collect the boxes of visible headings, paragraphs, list items, quotes and buttons (tag, up to 400 characters of text, font size, box width, indent, margins, padding, line height, plus the capture viewport width). They are sanitized field by field, kept in memory after the user accepts the import, and used as the document blocks of the layout shift prediction, the automatic fit, the support matrix and the on-device check. A fixed-width column caps the block width; a box that filled the capture viewport stays fluid. The panel shows where the layout comes from and offers to switch back to the sample article.
Privacy and security (see
docs/security.md): boxes are left out of the clipboard fallback, share links and exports; navigation chrome is skipped; spacing values are clamped and counts, text length and numbers are bounded; styles reach the sandboxed measuring frame through CSSOM only. Three independent reviews (code, security, requirements) and a re-check of the fixes are clean.Not done here (tracked in a follow-up issue): per-OS ranking still uses the sample article, direct URL import has no DOM and carries no boxes, and the import confirmation does not mention the boxes. Nothing in this PR needs the owner.
Verified:
pnpm verifyandpnpm test:e2e(E2E_PORT=4873) pass.🤖 Generated with Claude Code