Skip to content
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

PDF.js.js cannot be loaded when accessing urls with parameters #117

Closed
fno2010 opened this issue Dec 28, 2016 · 1 comment
Closed

PDF.js.js cannot be loaded when accessing urls with parameters #117

fno2010 opened this issue Dec 28, 2016 · 1 comment

Comments

@fno2010
Copy link
Contributor

fno2010 commented Dec 28, 2016

When accessing urls like following, PDF.js.js cannot be loaded:

http://delivery.acm.org/10.1145/3010000/3005771/p204-hari.pdf?ip=202.120.188.240&id=3005771&acc=ACTIVE%20SERVICE&key=BF85BBA5741FDC6E%2E1FD0E2C7647D7D03%2E4D4702B0C3E38B35%2E4D4702B0C3E38B35&CFID=881012010&CFTOKEN=39596783&__acm__=1482839995_25e653d93c192249a869fff952cbe81d

It should be fixed by changing matchingUrls to /\.pdf\?([^=]+=[^&]*)?(&[^=]+=[^&]*)*$/.

Further more, can we support something like filetype and ftdetec in vim? Currently, vimperator can only addUserMap by matchingUrls. Is it possible to support to match DOMs to decide which settings should be enabled?

fno2010 added a commit to fno2010/vimperator-plugins that referenced this issue Dec 28, 2016
Change matchingUrls to support urls with parameters.

Signed-off-by: jensenzhang <jingxuan.n.zhang@gmail.com>
@anekos anekos closed this as completed in ccfd48b Dec 31, 2016
anekos added a commit that referenced this issue Dec 31, 2016
Fix #117: PDF.js.js cannot be loaded
@fno2010
Copy link
Contributor Author

fno2010 commented Jan 7, 2017

Shall we reopen this issue or start another issue for discussion? Because I found matchingUrls is really not a good idea to autoload plugins.

In the dynamic websites, http servers will use route to select which pages should be rendered. So URL does often not direct a static file.

For example, https://github.com/<user>/<repo>/blob/<branch>/<path>/<whatever>.pdf will not direct a PDF file. Github will open a webpage with its own online pdf reader to display this PDF file. So PDF.js will not be loaded by FireFox.

But https://raw.githubusercontent.com/<user>/<repo>/<branch>/<path>/<whatever>.pdf will response a PDF file via HTTPS. The media type of its HTTPS response is application/pdf. So FireFox will load PDF.js.

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

No branches or pull requests

1 participant