A HTML widget viewer for the webR application, similar to browseURL()
#449
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A function
webr::viewer_install()
is added to the webR support package. The function sets R up so as to generate an output message over the webR communication channel when a URL viewer is invoked usingoptions("viewer")
.Printing a HTML element or HTML widget in the webR application app now shows the resulting HTML output in an embedded viewer
iframe
, meaning packages likegt()
can now work.c.f. #295, #384, #431.
Over the months I have considered several ways to handle requests to
browseURL()
from webR. After pondering for enough, in the interests of pragmatism this PR contains a "first-pass" approach that replaces relative JS and CSS sources in the output HTML file with content directly (encoded in base64) then displays the result in aniframe
. With thanks to @timelyportfolio, as this is an improvement to their basic implementation method outlined here.In the future, one or more of the following should be done, in order of "correctness":
/tmp
directory containing the HTML and support files. With this, relative URLs would "just work" without any modification.