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

Gestures no longer work in PDFs #284

Closed
ryanbr opened this issue Apr 10, 2018 · 9 comments
Closed

Gestures no longer work in PDFs #284

ryanbr opened this issue Apr 10, 2018 · 9 comments
Labels
external The bug is caused by Firefox or other external software.

Comments

@ryanbr
Copy link

ryanbr commented Apr 10, 2018

Describe your matter in detail

Mouse gestures no long work on pdfs (pdf.js) in Firefox nightly.

Install/Use Firefox nightly.
Visit; https://news.ycombinator.com/item?id=16797947
Click on the pdf link at the top
Wait for it to load, try to use a gesture to move back. No work.

Edit by Itchiii:
Firefox Version: 61.0a1 (Nightly)

@Itchiii
Copy link
Collaborator

Itchiii commented Apr 10, 2018

It seems like it's up to Firefox. The screenshot tool of Firefox also does not work anymore.
But it's probably not the same problem as #258. The CSP header is not set.

@Itchiii Itchiii added the external The bug is caused by Firefox or other external software. label Apr 10, 2018
@ryanbr
Copy link
Author

ryanbr commented Apr 10, 2018

This was a recent change from what I see. as in, the last few weeks.

@Itchiii
Copy link
Collaborator

Itchiii commented May 15, 2018

The problem already exists with version 60.0

@Itchiii Itchiii changed the title Firefox Nightly gestures no longer work in PDF Gestures do not work in PDFs May 15, 2018
@Itchiii Itchiii changed the title Gestures do not work in PDFs Gestures no longer work in PDFs May 15, 2018
@Robbendebiene
Copy link
Owner

To give an update:
Mozilla is already aware of this problem: https://bugzilla.mozilla.org/show_bug.cgi?id=1456485

@ryanbr
Copy link
Author

ryanbr commented May 30, 2018

@ryanbr
Copy link
Author

ryanbr commented May 30, 2018

looking through the #1456485 ticket, seems Gesturefy needs to change (like Screenshots) for this to be fixed now

@Robbendebiene
Copy link
Owner

Robbendebiene commented Aug 9, 2018

It looks like this behavior won't be changed in the near future according to this bug.

@maxsu
Copy link

maxsu commented Jul 6, 2019

A rather dodgy workaround: Part 1

  1. Use the Google PDF Viewer extension.
  2. Curse under your breath
  3. Gestures work now

This extension sends pdf urls directly to Google Doc's PDF viewer, and so preserves content script injection. This approach fails with readers based on Extension Pages (like Literal PDF Reader).

Disclaimer: I have no idea about the security of this approach!

A rather dodgy workaround: Part 2

  1. Steal a web-hosted implementation of pdf.js, such as this one by @giuseppeg; add support for a pdf query string. (sandbox)

    Example: https://tnds0.codesandbox.io/?pdf=https://arxiv.org/pdf/1307.7118.pdf

  2. Redirect pdf URLs to your custom PDF viewer endpoint (while cursing)

    Redirector entry:

{
    "description": "PDF Redirector",
    "exampleUrl": "https://arxiv.org/pdf/1307.7118.pdf",
    "exampleResult": "https://tnds0.codesandbox.io/?pdf=https://arxiv.org/pdf/1307.7118.pdf",
    "error": null,
    "includePattern": "(^https?://.*\\.pdf$)",
    "excludePattern": "",
    "patternDesc": "",
    "redirectUrl": "https://tnds0.codesandbox.io/?pdf=$1",
    "patternType": "R",
    "processMatches": "noProcessing",
    "disabled": false,
    "appliesTo": [
        "main_frame"
    ]
}
  1. Gestures work now

Needless to say, this could be EVEN WORSE from a security standpoint.

Next steps

  1. Incorporate a nicer pdf.js interface, like this one from Mozilla's pdf.js demo. This is the pdf.js interface we know and love.
  2. Openly weep when a malicious pdf hijacks the page.

@Robbendebiene
Copy link
Owner

It seems unlikely that Firefox/Mozilla will ever allow extensions to run inside the pdf reader. Therefore I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The bug is caused by Firefox or other external software.
Projects
None yet
Development

No branches or pull requests

4 participants