Skip to content

fix: replace iframe with link in build_inspect_data#485

Open
mvanhorn wants to merge 1 commit into
compiler-research:mainfrom
mvanhorn:fix/484-inspect-iframe-link
Open

fix: replace iframe with link in build_inspect_data#485
mvanhorn wants to merge 1 commit into
compiler-research:mainfrom
mvanhorn:fix/484-inspect-iframe-link

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the <iframe> in build_inspect_data (src/xinspect.cpp) with a plain <a> anchor that opens the documentation URL in a new tab
  • Removes the now-unused #pager-container / .xcpp-iframe-pager CSS block
  • Adds a unit test in test/test_interpreter.cpp that asserts the returned text/html contains an <a href> and no <iframe>

Why this matters

Closes #484. cppreference.com migrated to MediaWiki, which sets X-Frame-Options: DENY by default as a deliberate security policy. This blocks the <iframe> pager in every browser (Chrome, Safari, JupyterLite), leaving the Shift+Tab inspect panel blank for all users. The maintainer confirmed that changing the cppreference server config is not feasible, so the fix must be on the xeus-cpp side. A clickable link is the simplest correct replacement - it requires no special permissions and works in all Jupyter environments.

Fixes #484

cppreference.com sets X-Frame-Options: DENY (MediaWiki default), which
causes every browser to block the <iframe> used in build_inspect_data.
Replace it with a plain <a> anchor that opens the documentation URL in
a new tab, keeping the existing text/plain field intact.

Adds a unit test asserting the output contains an <a href> and no
<iframe>.

Fixes compiler-research#484
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.01%. Comparing base (82f9064) to head (e23f5ed).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #485      +/-   ##
==========================================
+ Coverage   73.99%   74.01%   +0.02%     
==========================================
  Files          23       23              
  Lines        1196     1197       +1     
  Branches      111      111              
==========================================
+ Hits          885      886       +1     
  Misses        311      311              
Files with missing lines Coverage Δ
src/xinspect.cpp 91.96% <100.00%> (+0.07%) ⬆️
Files with missing lines Coverage Δ
src/xinspect.cpp 91.96% <100.00%> (+0.07%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

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.

[Bug] inspect request failure

2 participants