Repository navigation
refactor(page): wire the page's buttons in script instead of inline onclick attributes - #147
Merged
Merged
Conversation
…nclick attributes A Content-Security-Policy with a script nonce blocks inline event-handler attributes. The four buttons (Load my links, Cancel, Remove verification, Check) now get click listeners from the page's existing script, calling the same functions as before. A test fails if either page carries an on* attribute or a javascript: URL.
…dler test The button listeners now come before the start-up block, so an error there cannot leave the buttons dead (the inline handlers used to survive that). A test pins the ordering. The wiring check no longer depends on quote style or a trailing semicolon, and the markup check handles a '>' inside an attribute value.
The wiring tests matched source text, so a commented-out or never-run listener passed. They now run the page's wiring lines against stand-in buttons and check each click reaches its own function. The Check button also gets type="button" like the others; the page has no form, so nothing changes.
mbradley
requested review from
a team,
dcadenas and
rabble
and removed request for
a team
October 15, 2026 17:39
roborev: Combined Review (
|
dcadenas
approved these changes
Oct 15, 2026
dcadenas
left a comment
Member
There was a problem hiding this comment.
The four buttons keep their existing actions, with listeners registered before page startup.
No actionable findings at 00414ef.
Checks
npm run typecheck: passed.npm run test:once: 52 files and 1,654 tests passed. The interactive test command was not run separately.- CI on the reviewed commit passed, including the executed Typecheck, Test, and semantic-title validation steps. CLA and roborev also passed.
- The regression tests cover the emitted button wiring and both pages' markup, but do not run a browser or the remote-signer flow.
Local checks used Node 26.8.1; CI used Node 24.
I did not rerun browser checks; the description reports Chromium and WebKit testing, with Firefox untested.
This is preparation for #138, not the Content-Security-Policy rollout itself.
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.
Summary
onclickattributes (Check, Load my links, and the remove dialog's Cancel and Remove) now get their click handlers from the page's script. Each calls the same function as before.type="button", like the other three./or/verify/...) gains an inline event-handler attribute or ajavascript:URL.Motivation
Related Issue
Testing
npm run test:once: 52 files, 1654 tests passed.npx tsc --noEmit: clean.onclickreturns, if the wiring moves after the start-up code, or if anonclickhides behind a quoted>.wrangler dev: each of the four buttons, by mouse click, Enter and Space, behaved the same as onmain, with no console errors. Firefox was not run.API / Behavior Notes
Sensitive Information Check