-
Notifications
You must be signed in to change notification settings - Fork 972
PDF doesn't open in a new tab #12008
Comments
I've had this problem as well on other sites, but not really sure what circumstances cause it. |
The pdf does load if it is the link itself that opens the new tab (e.g. when left-clicking on a pdf-link in gmail), but not when the user opens the new tab (e.g. ctrl-clicking the pdf-link). |
This is the same issue as #11059 ? |
CC @diracdeltas |
Fixing this likely requires fixing 2 bugs. First, an HTML page is being served with a
This then confuses the PDF check in /**
* Converts a potential PDF URL to the PDFJS URL.
* XXX: This only looks at the URL file extension, not MIME types.
* @param {string} url
* @return {string}
*/
toPDFJSLocation: function (url) {
if (url && UrlUtil.isHttpOrHttps(url) && UrlUtil.isFileType(url, 'pdf')) {
return UrlUtil.getPDFViewerUrl(url)
}
return url
}, Once that's fixed, the next problem is that brave doesn't yet know how to serve PDFs to sub-frames on a page, see my recent comments in #12992. This is likely a dupe of #12763. |
I can copy and paste https://ethereum.github.io/yellowpaper/paper.pdf into the URL bar and it will open the PDF in the tab. Right clicking and opening the link in a new tab also works. If I left-click the link it prompts to download it. Perhaps it also has something to do with different PDF versions, e.g. if it is PDF1.5 or later, it will be compatible with browser extensions as listed here. |
Looks like that link both uses
You're right about the left-click downloading vs. showing, which I think is due to the I'll add my notes above to that other bug. |
Steps to Reproduce
Go to this link. The PDF doesn't load, while it does in Firefox and Chrome. Note that if you go to https://github.com/ethereum/research/blob/master/papers/CasperTFG then click on CasperTFG.pdf it will render on Github, as it does on Chrome and Firefox. If you try to open it in a new tab it doesn't load. It doesn't make a difference if all cookies are allowed, nor if Brave shields are down.
Actual result:
Expected result:
Reproduces how often:
100%
Brave Version
Brave: 0.19.80
rev: 7d07299
Muon: 4.5.13
libchromiumcontent: 62.0.3202.75
V8: 6.2.414.36
Node.js: 7.9.0
Update Channel: Release
OS Platform: Linux
OS Release: 4.13.0-17-generic
OS Architecture: x64
Reproducible on current live release:
Yes
The text was updated successfully, but these errors were encountered: