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

Use iframe to support more complex sites #102

Open
fonsp opened this issue May 17, 2021 · 2 comments
Open

Use iframe to support more complex sites #102

fonsp opened this issue May 17, 2021 · 2 comments

Comments

@fonsp
Copy link

fonsp commented May 17, 2021

Hi!

I made a version of this website that uses an iframe at full size to render the HTML content, which removes the needs for tricks like this one, and allows more complex pages to load correctly.

It uses iframeresizer to resize the iframe to match the content size. We fetch the HTML content from the raw URL like is done today, and then generate an object URL from the HTML content to use as the iframe source.

Try it out here:

https://htmlview.glitch.me/

(Source code is available on the top right of the page)


As an example, this HTML file does not work on the current site, likely because of script loading issues, but it does work with the iframe strategy:

https://github.com/mossr/PlutoNotebooks/blob/master/html/em_algorithm.html

I also added direct support for gist urls like https://gist.github.com/fonsp/a06a1359b612d22f7dbdb6256da1cf2d

Would you be interested in a PR? It would replace most of the existing codebase, but it seems like a more stable solution, and I suspect that it solves some of the currently open issues.

-fons

@twilsonco
Copy link

Cool approach. Can it be made to handle links so that the entire site is navigable? I'm interested in looking at profiling results rendered in html such as this, where if prepended with the htmlpreview url, doesn't load the flamegraph. If I inline the flamegraph, then it loads, but then links don't follow through correctly. Your approach has similar problems. Doesn't load the flamegraph, or it does, but either way the links on the page don't work.

I figure the most direct way to fix my problem is to include object fields in the processing for this tool.

@niutech
Copy link
Collaborator

niutech commented Sep 25, 2023 via email

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

3 participants