Repository navigation
Description
System details
RStudio Edition : Server
RStudio Version : 2022.07.2+576 "Spotted Wakerobin" Release (e7373ef832b49b2a9b88162cfe7eac5f22c40b34, 2022-09-06) for Ubuntu Bionic
OS Version : Ubuntu 20.04.5 LTS
R Version : 4.2.1 (2022-06-23) -- "Funny-Looking Kid"
Steps to reproduce the problem
- Load RStudio into an iframe with the sandbox attribute present.
- Create a new project
File > New Project > New Directory > New Project > Create Project.
I have attached a minimal working demo of the issue with a docker-compose file.
rstudio_sandbox_issue.tar.gz
Describe the problem in detail
Issue
Given R Studio is rendered in a sandboxed iframe, when I create and new project then it hangs on a toast saying "Switching to project path/to/project...". An error appears in the javascript console, akin to:
Unsafe attempt to initiate navigation for frame with URL 'http://localhost/rstudio/' from frame with URL 'http://localhost/rstudio/'. The frame attempting navigation is sandboxed, and is therefore disallowed from navigating its ancestors.
The issue only arises when the sandbox attribute is present. However, removing the sandbox attribute is not an option for us.
This is the same issue as previously raised on the community forum.
Other observations
The project does load successfully if the top level navigation is manually refreshed.
The javascript that triggers the refresh is calling $wnd.location.replace(X). Setting a breakpoint where the error is thrown and instead manually invoking $wnd.location.reload() performs the refresh without issue, and the new project loads as expected.
Describe the behavior you expected
When I create a new project in R studio that is rendered in a sandboxed iframe, the new project loads.
- I have read the guide for submitting good bug reports.
- I have installed the latest version of RStudio, and confirmed that the issue still persists.
- [] If I am reporting an RStudio crash, I have included a diagnostics report.
- I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
Activity
ronblum commentedon Nov 2, 2022
@dan-aridhia Thank you for raising this! Unfortunately, we don't support running the open source version of RStudio inside of an iframe. It's only available in the professional version. (If you're curious, it's described in the Tutorial API chapter of the admin guide
ronblum commentedon Nov 2, 2022
@dan-aridhia I apologize—I'm totally wrong: Running in an iframe is absolutely supported in the open source version, as a security feature. (Covered in the Security Considerations chapter, but you probably already know that. 🙂 )
ronblum commentedon Nov 2, 2022
Back to the original issue: We don't currently support sandboxed iframes. However, I'll switch this over to an enhancement request for review as we continue to develop RStudio. And sorry for the pendulum swing!
dan-aridhia commentedon Nov 4, 2022
@ronblum no problem, thanks for the updates. I have reproduced the issue using rstudio workbench. As suspected, this issue is not specific to the open source version of R Studio - it is an issue with the R Studio IDE itself.
github-actions commentedon May 4, 2023
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.
github-actions commentedon May 18, 2023
This issue has been automatically closed due to inactivity.