android-pdf-js icon indicating copy to clipboard operation
android-pdf-js copied to clipboard

Sadly it does not work for me

Open MChrisp opened this issue 2 years ago • 5 comments

As you requested an issue here in GitHub. I followed instructions for enabling AddOns in Firefox Nighty. I selected my own AddOn Selection, enabled the extension. I tried to open a PDF in Firefox from drive.proton.me try this https://drive.proton.me/urls/2AZV8KM548#7Tm8waVTnial

Can only download the file.

I have a Google Pixel 6 Pro. Firefox Nightly: 103.0a1 (Build #2015884011), e2fdca8d4+ AC: 103.0.20220601143117, 7c085b66d9 GV: 103.0a1-20220601094632 AS: 93.1.0 Android: Build SP2A.220505.002

Screenshot_20220602-143658.png

MChrisp avatar Jun 02 '22 12:06 MChrisp

Let me know, if I can give you more information.

MChrisp avatar Jun 02 '22 13:06 MChrisp

Thanks for the nice description. This is an interesting case. Even though the chance that it can not be fixed at all are pretty high.

If you open the PDF on your Desktop Firefox, you'll see that the URL is not an "regular URL" but the website creates an "blob:" URL. Probably they are doing this to make it impossible that people just directly link to the PDF but always have to go over their website and click the link manually. Actually I don't know why they even bother as the website does not have any ads on it.

If you have a look at what types of URLs can be intercepted by Add-ons (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) then we have:

  • http
  • https
  • ws
  • wss
  • ftp
  • data
  • file

But no "blob". If you try any other website which hostes PDFs (or probably just google for "PDF test" and click the first entry), then you'll see that the Add-on works. You just found an edge case.

If you really need to view the type of PDF you have here, I could try to open a bug on Bugzilla so Mozilla can decide. But if they decide against it, all I can do is closing here.

M-Reimer avatar Jun 03 '22 14:06 M-Reimer

I had some time for some debugging, now, and as expected the webRequest API does not allow me to handle "blob:" URLs.

I have forwarded this issue to Mozilla now: https://bugzilla.mozilla.org/show_bug.cgi?id=1772700

M-Reimer avatar Jun 04 '22 15:06 M-Reimer

Thanks. Got it.

MChrisp avatar Jun 04 '22 17:06 MChrisp

My bug report was closed and "forwarded" to another one. So the relevant bug, this one depends on, is now:

https://bugzilla.mozilla.org/show_bug.cgi?id=1457500

And so both remaining issues for my Add-on basically depend on the same bug and are more or less caused because I have to somehow make something with the interfaces provided by Mozilla. They are planning to provide something better, but it also is common practice that bugs, only Add-ons depend on, are open for years. So probably no fix in the near future.

M-Reimer avatar Jun 14 '22 12:06 M-Reimer