Repository navigation
fix(viewer): await setViewerUrl IPC before navigating iframe to prevent cross-origin SecurityError (#17982) - #18066
Conversation
b6fe871 to
80eb3e6
Compare
…nt cross-origin SecurityError (#17982) The viewer pane iframe could be blocked by Electron's navigation policy, causing cross-origin SecurityErrors when previewing markdown files or R Notebooks as HTML. The setViewerUrl IPC call is now awaited before the iframe navigates, ensuring the URL authority is registered in time. - Change setViewerUrl IPC from send to handle/invoke for synchronous result, ensuring the URL is registered before navigation - Update GWT DesktopFrame interface to accept a callback after IPC - HTMLPreviewPanel and ViewerPresenter now await the IPC result before calling previewFrame_.setUrl() - Remove test.skip/fixme markers from markdown and rnotebook preview tests since the underlying issue is now fixed
80eb3e6 to
85c3c63
Compare
…mport Fix compilation errors in HTMLPreviewPanel and ViewerPresenter caused by importing a non-existent org.rstudio.core.client.Command class. Switch to the correct GWT class com.google.gwt.user.client.Command.
Code review findingsActionable items from an automated multi-agent review. The fix itself is sound — deferring iframe navigation into the Important
Suggestions
|
🍎 macOS Desktop E2E · ARM64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · macos-26 ARM64 · commit |
🪟 Windows Desktop E2E · Server 2025 x64✅ All tests passed!
📥 Download Playwright report⬇️ playwright-report.zip — extract and open
2 shards · Windows Server 2025 x64 · commit |
Summary
Fixes #17982
The viewer pane iframe could be blocked by Electron's navigation policy, causing cross-origin SecurityErrors when previewing markdown files or R Notebooks as HTML. The
setViewerUrlIPC call is now awaited before the iframe navigates, ensuring the URL authority is registered in time.Changes
src/node/desktop: ChangesetViewerUrlIPC fromsendtohandle/invokefor synchronous result, ensuring the URL is registered before navigationsrc/gwt: UpdateDesktopFrameinterface to accept a callback after IPC completes;HTMLPreviewPanelandViewerPresenternow await the IPC result before callingpreviewFrame_.setUrl()e2e/rstudio/tests: Removetest.skip/test.fixmemarkers from markdown and rnotebook preview tests since the underlying issue is now fixedNEWS.md: Added changelog entry