fix(extension): route Trusted-Types/CSP eval failures to the CSP-strip bypass (v0.17.7)#115
Conversation
…p bypass (v0.17.7) MAIN-world eval on pages with a strict require-trusted-types-for 'script' policy was rejected and returned early, never reaching the extension's existing per-tab CSP-header-strip + reload bypass. Make Trusted-Types (and userScript-CSP) failures fall through to that path so strict-Trusted-Types sites become eval-able. No new permissions or API surface — it widens the trigger of an existing mechanism, not the mechanism. Also refresh the built content bundle to match source already on main (a11y out-of-flow portal visibility, MAIN-world pointerdown gesture for Radix/Floating-UI menus, double content-script injection guard) and bump the version across all surfaces (extension manifests, package.json, CLI) to 0.17.7. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR releases version 0.17.7. It tightens CSP/Trusted Types eval fallback control flow so blocked results fall through to the strip-and-reload path, gates accessibility tree landmark and heading nodes on computed element visibility, adds cooperative click interception via custom events, guards against duplicate content script handler registration, and bumps version strings across manifests and package files. ChangesCSP / Eval Fallback, A11y Tree, Click Interception, Duplicate Guard
Version Bump to 0.17.7
Sequence DiagramsequenceDiagram
participant ContentScript
participant PageScript
participant BackgroundSW
rect rgba(100, 149, 237, 0.5)
Note over ContentScript, PageScript: Cooperative Click Interception
ContentScript->>ContentScript: install __interceptor_click_ack capture listener
ContentScript->>PageScript: dispatchEvent(__interceptor_click, {x, y})
alt interceptor ack received
PageScript->>ContentScript: dispatchEvent(__interceptor_click_ack)
ContentScript->>ContentScript: return early (skip pointer/mouse sequence)
else no ack
ContentScript->>ContentScript: dispatch standard pointer/mouse/click events
end
end
rect rgba(144, 238, 144, 0.5)
Note over ContentScript, BackgroundSW: CSP Eval Fallback
ContentScript->>BackgroundSW: evaluate request
BackgroundSW->>BackgroundSW: userScripts initial attempt
alt still CSP-blocked after fallback
BackgroundSW->>BackgroundSW: fall through to CSP-strip bypass + reload
BackgroundSW->>BackgroundSW: MAIN world eval after CSP removed
else fallback succeeded / non-CSP error
BackgroundSW->>ContentScript: return fallback result
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
evalon pages with a strict Trusted-Types CSP (require-trusted-types-for 'script') was rejected and returned early, never reaching the extension's existing per-tab CSP-header-strip + reload bypass. This routes Trusted-Types and userScript-CSP failures into that bypass so strict-Trusted-Types sites become eval-able.main(a11y out-of-flow portal visibility, MAIN-world pointerdown gesture for Radix/Floating-UI menus, double content-script injection guard).package.json, CLI) to0.17.7.Behavior
unsafe-evalallowedunsafe-evalblockedrequire-trusted-types-for 'script'Notes
mainmerge only.🤖 Generated with Claude Code
Summary by CodeRabbit
Version 0.17.7
Chores
Bug Fixes
New Features