gdcc / dataverse-previewers

A collection of Datafile Previewers that can be configured to work with Dataverse
MIT License
5 stars 15 forks source link

Added rich HTML previewer #40

Closed JR-1991 closed 10 months ago

JR-1991 commented 1 year ago

Overview

As discussed in issue #31 and in previous chats with @qqmyers and @pdurbin, this PR introduces an insecure HTML previewer to allow users to display pages that contain script tags. This is especially useful in cases where interactive figures or other third-party libraries are involved in rendering data.

How it works

Upon redirecting to the external tool, the user is presented with a confirmation window that discloses the potential risks of using the previewer. The whole HTML page will be rendered with its script content if given consent. The user will be redirected to the dataset page if no consent is given.

Example

I've included an example based on an example found on this DaRUS file using Plotly for an interactive plot. For reproducibility adapt the following URL:

http://localhost:3001/previewers/betatest/RichHtmlPreview?fileid=198953&siteUrl=https://darus.uni-stuttgart.de&datasetid=198952&datasetversion=1.0

Using the default HTML previewer

image

Using the rich HTML previewer from this PR

image

The consent message

image