Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Trigger the call of pdfjs on MIME type rather than extension #2633

Closed
babolivier opened this issue Jul 21, 2016 · 4 comments
Closed

Trigger the call of pdfjs on MIME type rather than extension #2633

babolivier opened this issue Jul 21, 2016 · 4 comments

Comments

@babolivier
Copy link

I just noticed that pdfjs was systematically called on any URL ending with .pdf, such as http://sdfgsdfgsd.com/test.pdf (which doesn't exist) or https://github.com/Intel-Media-SDK/samples/blob/master/samples/sample_decode/readme-decode_linux.pdf (which returns HTML content, not readable by a PDF reader). I think that pdfsj should be called regarding the response MIME type (application/pdf for PDF) and not how the URL is ending.

  • Platform (Win7, 8, 10? macOS? Linux distro?): Linux
  • Brave Version: 0.11.1
  • Steps to reproduce:
    1. Open a new tab
    2. Write or paste an URL (leading to an existing resource or not) containing a domain name and a path ending in .pdf

pdf

@diracdeltas
Copy link
Member

++, i think this is causing problem on PDFs that redirect to an HTML page for auth (ex: in slack)

this may be fixed by taking out the setPDFLocation calls in js/stores/windowStore.js, which are a workaround for PDFs not loading at all unless they fire an Electron navigation event

@diracdeltas
Copy link
Member

verified that pdfjs does MIME detection in webRequest.onHeadersReceived so this should be fixed by reverting the workaround for the other bug

@luixxiul
Copy link
Contributor

in 0.11.2?

@bbondy
Copy link
Member

bbondy commented Jul 26, 2016

we will put all in 0.11.2 that's in master and freeze as soon as chromium 52 is avail.

@bbondy bbondy added this to the 0.11.2dev milestone Jul 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants