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

Support PDFs #1331

Closed
casey opened this issue Jan 22, 2023 · 3 comments
Closed

Support PDFs #1331

casey opened this issue Jan 22, 2023 · 3 comments

Comments

@casey
Copy link
Collaborator

casey commented Jan 22, 2023

Someone inscribed the bitcoin whitepaper, so we should support PDFs:

https://ordinals.com/content/85b10531435304cbe47d268106b58b57a4416c76573d4b50fa544432597ad670i0

@casey
Copy link
Collaborator Author

casey commented Jan 22, 2023

PDFs may be hard to support:

whatwg/html#3958
https://bugs.chromium.org/p/chromium/issues/detail?id=413851

Chrome renders PDFs with a plugin, and plugins aren't allowed inside sandboxed iframes. Inscription previews are all iframes, so we would have to un-sandbox iframes containing PDFs. This would suck, since it breaks our current model of not needing to know anything about inscriptions to render them, just instantiate an iframe with the right /preview URL.

PDFs are also pretty bonkers in general. They can contain scripts, and do other wacky things. Our best option may be to use some kind of PDF preview service, or render them using JS.

@casey
Copy link
Collaborator Author

casey commented Jan 24, 2023

The way to do this is probably https://github.com/mozilla/pdf.js.

@casey
Copy link
Collaborator Author

casey commented Jan 25, 2023

It is done, and it wasn't even that bad!

@casey casey closed this as completed Jan 25, 2023
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

1 participant