Skip to content

fix: render attribute JSON in Safari using textContent#13

Open
urre wants to merge 1 commit into
masterfrom
fix/master/safari-json-rendering
Open

fix: render attribute JSON in Safari using textContent#13
urre wants to merge 1 commit into
masterfrom
fix/master/safari-json-rendering

Conversation

@urre

@urre urre commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Problem

The debug-attribute action page renders the Subject / Context / Action attribute JSON inside hidden <code class="...-json hide"> elements (.hide is display:none) and uses an inline script to pretty-print them into the visible <pre> blocks.

The script read those elements with .innerText. WebKit/Safari returns an empty string for innerText of a display:none element, whereas Chrome falls back to the underlying text. The result: the JSON blocks rendered as empty boxes in Safari while working correctly in Chrome.

Chrome Safari (before)
JSON renders empty [] boxes

Fix

  • Switch the three .innerText reads to .textContent, which ignores CSS rendering state and behaves consistently across browsers (and is the value we actually want — the raw JSON the server wrote into the element).
  • Replace the dead $!button_color Velocity quiet-reference on the Continue button with the literal button-primary class. It was never populated by the plugin or a theme, so it silently rendered as nothing.

Testing

Built the plugin and deployed it to a local Curity Identity Server (11.x), attached the action to an authenticator, and confirmed the Subject/Context/Action JSON now renders in Safari as it already did in Chrome. Copy JSON (which uses .innerHTML) was unaffected.

Notes

  • Template-only change; no Java changes. Plugin version left at 1.4.3 — let me know if you'd prefer a 1.4.4 bump for release.

Screenshot

CleanShot 2026-06-03 at 17 18 32@2x

The Subject/Context/Action attribute JSON is stored in hidden
`<code class="...-json hide">` elements (`.hide` is `display:none`) and
read by the inline script to pretty-print it. The script used
`.innerText`, which WebKit/Safari returns as an empty string for
`display:none` elements (Chrome falls back to the text content). As a
result the JSON blocks rendered empty in Safari while working in Chrome.

Switch the three reads to `.textContent`, which is unaffected by CSS
rendering state and behaves consistently across browsers.

Also replace the dead `$!button_color` Velocity quiet-reference on the
Continue button (never populated by the plugin or a theme, so it
rendered as nothing) with the literal `button-primary` class.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@urre urre requested a review from daniellindau June 3, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants