-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Failure to open local file in windows platform #9020
Comments
@juncaixinchi - We had a similar issue. PDFJS switched in the 1.9 release to the fetch api. Fetch in Electron doesn't work the same way as XHR wrt the file:// protocol. |
@pcad if you use webpack, you can set However, due to the bug I refered in this issue, it's only working in Linux or Mac platform, failed in windows. |
Get correct path in node_stream on windows platform( issue #9020)
So what's the solution to this problem? |
@matteodem A PR(#9323) has been added to solve this problem, you can try the latest release, it should be OK. |
@juncaixinchi I get following error:
see http://jsfiddle.net/9engc9mw/2601/ Does the build version have to be updated too? |
That's becasue the fetch api does not support You should use If you are electron and webpack user, see #9020 (comment) |
@juncaixinchi ...so this means this is not possible? as in the original issue is unresolved / unresolvable? |
@matteodem It's not possible to use the fetch api to load local files via |
Get correct path in node_stream on windows platform( issue mozilla#9020)
Configuration:
Electron 1.7.8 ( use webpack and set
target: 'electron-renderer'
)Windows 10
pdfjs-dist: 1.9.640
no
Steps to reproduce the problem:
C:/User/1234/Desktop/a.pdf
file:///C:/User/1234/Desktop/a.pdf
/C:/User/1234/Desktop/a.pdf
C:\C:\User\1234\Desktop\a.pdf
What went wrong?
the pr #8928 is not working
path before
decodeURI
:/C:/User/1234/Desktop/a.pdf
. Howerver, afterdecodeURI
, path is still the same.see also
#8946
The text was updated successfully, but these errors were encountered: