Skip to content

build custom metric dropdowns with DOM APIs#3867

Draft
1seal wants to merge 1 commit into
google:masterfrom
1seal:fix/custom-metrics-dom-construction
Draft

build custom metric dropdowns with DOM APIs#3867
1seal wants to merge 1 commit into
google:masterfrom
1seal:fix/custom-metrics-dom-construction

Conversation

@1seal

@1seal 1seal commented Apr 22, 2026

Copy link
Copy Markdown

summary

this replaces HTML string concatenation in startCustomMetrics() with jQuery DOM construction for custom metric dropdowns.

why

custom metric names were previously interpolated into markup before being passed to $(), which let the browser parse attacker-controlled content as HTML instead of treating it as data.

what changed

  • build the dropdown wrapper, button, caret, label container, and metric container with jQuery element constructors
  • keep the custom metric name in attribute values created through DOM APIs rather than through parsed HTML strings

validation

  • node --check cmd/internal/pages/assets/js/containers.js
  • local red/green verification with the attached reproduction artifacts:
    • make canonical
    • make fixed

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open 90 days with no activity. This PR will be closed in 30 days unless new comments are made or the stale label is removed. To skip these checks, apply the "lifecycle/frozen" label.

@github-actions github-actions Bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant