-
Notifications
You must be signed in to change notification settings - Fork 16
Conversation
+1 to merging this. I have a cleaned up version almost ready to go through CI, but needs a look at these two test cases.
So for one we'll have a different PDF URL than the mozilla one, but how should we handle http respect? Is there a way to mock SSL in the test and expect |
I don't think we should need to mock anything there for tests, since the tests aren't actually making an HTTPS request, just checking that the markup returned by the callback includes an iframe with an https src. The shortcode callback will need to be updated to handle that, but I'm not sure if checking the protocol of the PDF is the best way to do that - trying to serve an https iframe from a site without a valid ssl certificate will cause problems. I'd like to see some messaging added about the CORS issues involved - trying to test it out I couldn't find any public pdfs online with CORS headers, so I had to download one and upload it to test this out. I do like the idea about a CORS proxy as mentioned on the issue, as long as it was optional and could be disabled by a filter. It might be a good idea to expose an attribute on the shortcode as a checkbox which would run the PDF through a local proxy. I'm not a huge fan of the size of this PR, but I don't know of any standard ways of handling package dependencies in WP plugins. If anyone has a preference for ways to include this as a package (git submodule seems to make the most sense to me, but I see composer being used for this also) rather than checking all 367 files into this repo, I'd say go for it. We'd have to check them in to svn in the plugin repo, but at least the diffs wouldn't be so huge here. |
Ah, I guess I see why you didn't go this route in the first place. Looks like there's two possible packages that could be pulled from - the pdfjs-dist repo, which includes builds files of the basic script files and stylesheets required, but not the html template, and the |
@goldenapples Agree with your reasoning. CORS Proxy would be nice but I also think we could handle it outside scope of this PR. I looked into the repo options with PDF.js and agree with your analysis, the directory we have right now from I have another PR in progress that updates the test cases, perhaps we can continue the conversation there? #197 |
Yeah, looks like that module is just the
👍 I'll close this PR for now and move discussion over there. |
Fixes #192.
This is pretty huge, so might warrant splitting into a separate plugin at this point, tbh. Figured I'd file the PR in any case. :)