Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML preview maybe should work with local images? #103

Open
ocdtrekkie opened this issue Mar 4, 2020 · 2 comments
Open

HTML preview maybe should work with local images? #103

ocdtrekkie opened this issue Mar 4, 2020 · 2 comments

Comments

@ocdtrekkie
Copy link
Contributor

I host a website out of a Davros grain. It's a bit odd to me that when I preview the index.html file, it does render, yet fails to embed the image stored in the same folder in Davros. It's not a big deal as I can visit the publishing URL, it just seems odd to me that it doesn't work?

But then I kind of looked, and realized HTML files preview as "code", so I wondered if it rendering the HTML at all was a mistake...

@mnutt
Copy link
Owner

mnutt commented Aug 13, 2020

You're right, I think it was a mistake that it rendered at all. My general pattern for rendering previews of untrusted content is to xhr-fetch the contents and add them as srcdoc to a sandboxed iframe, and without allow-origin I'm not sure it'd be able to render relative images but can test it to see.

@mnutt
Copy link
Owner

mnutt commented Aug 19, 2021

Unfortunately I think this may end up out of scope; it may just be too hard to preview a page safely while allowing local images but disallowing remote image loads. But I can investigate it some more at a future date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants