Skip to content

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

Description

@fno2010

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?

Activity

  1. added 2 commits that reference this issue on Dec 28, 2016
    fd54f8c
    ccfd48b
  2. added a commit that references this issue on Dec 31, 2016
    2774fe0
  3. fno2010 commented on Jan 7, 2017

    @fno2010
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions