Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Include PDF.js rather than hotlinking from mozilla.github.io #192

Open
rmccue opened this issue Nov 16, 2016 · 4 comments
Open

Include PDF.js rather than hotlinking from mozilla.github.io #192

rmccue opened this issue Nov 16, 2016 · 4 comments

Comments

@rmccue
Copy link
Contributor

rmccue commented Nov 16, 2016

Right now, the PDF shortcode outputs an iframe which loads https://mozilla.github.io/pdf.js/web/viewer.html

Since this is on a different origin, it requires local PDFs (in uploads, e.g.) to have cross-origin headers. If this was bundled with Shortcake Bakery instead, CORS headers would not be required for local PDFs.

(As a sidenote, maybe having UI to select a local PDF rather than just a URL would be cool too.)

@danielbachhuber
Copy link
Contributor

I tried this at the very beginning, and ran into some issue where I realized it was easier to just hotlink.

This was the original post for the shortcode, btw http://fusion.net/story/31465/here-are-the-best-parts-of-the-leaked-budget-for-the-interview-north-koreas-least-favorite-movie/

@danielbachhuber
Copy link
Contributor

Looks like someone broke the S3 bucket :)

image

@rmccue
Copy link
Contributor Author

rmccue commented Nov 16, 2016

Potentially building in a CORS proxy might work as well, although could have copyright repercussions since you're essentially rehosting the content, plus performance would suckkkkk.

@goldenapples
Copy link
Contributor

#197 makes it possible to embed locally-hosted pdfs.

To do in followup:

  • Document development/contributing process, and process for installing from git, now that the plugin uses submodules
  • Investigate a CORS proxy pass which can be enabled on the shortcode with an attribute flag
  • Investigate UI improvements for selecting a local attachment from the Media Library

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

No branches or pull requests

3 participants