Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for viewing external sandboxed URLs in the Viewer pane #2252
Comments
|
Some investigation notes:
|
|
I just ran into this issue, and I'm glad that it has already been tracked here. Thanks! |
with RStudio 1.2.x, rstudioapi::viewer('https://www.rstudio.com') will open the URL in an external browser rstudio/rstudio#2252
|
This is implemented now. Note that sandboxing introduces a bunch of restrictions:
|
|
Also, for QA: the |
|
It looks like this is no longer working.
and a few other URLs I tried don't actually show up in the viewer. |
|
I can confirm that as of RStudio v1.2.1522 The only way around this is: tfile = tempfile(fileext=".html")
download.file("http://google.com/", tfile)
rstudioapi::viewer(tfile)Even then, clicking on a link will trigger a browser window to open... |
#22) * Enable opening the URL inside of the RStudio window. * Update README file with new option * Add a NOTE * Switch default to `FALSE` as RStudio is not appropriately sandboxing the environment. rstudio/rstudio#2252
|
I have been messing around with this and it seems like this is being caused by the rstudio/src/cpp/desktop/DesktopWebPage.cpp Lines 356 to 381 in 4949a51 which are allowed to be opened by the viewer. Is the safe hosts concept still necessary? If so is it possible to relax it somewhat such that users are warned about visiting an unsafe host and then able to progress or not via a modal dialog? Also, while I was looking through the code it seemed like it would also be useful to expand the |
In RStudio Desktop 1.1, we are very careful to disallow navigation to external URLs for security reasons. See e.g. here:
rstudio/src/cpp/desktop/DesktopWebPage.cpp
Line 226 in 94806f3
Now that we are on
QtWebEngine, however, we have access to a working sandbox for IFrames; this has been part of Chromium for some time.https://www.chromestatus.com/feature/5715536319086592
We could choose to enable external URLs in the Viewer, which would open up a number of possibilities for external service integration with the IDE, if we can validate that sandboxing them allows us to do so safely and securely.