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

Sadly it does not work for me #21

Open
MChrisp opened this issue Jun 2, 2022 · 5 comments
Open

Sadly it does not work for me #21

MChrisp opened this issue Jun 2, 2022 · 5 comments

Comments

@MChrisp
Copy link

MChrisp commented Jun 2, 2022

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
Copy link
Author

MChrisp commented Jun 2, 2022

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

@M-Reimer
Copy link
Owner

M-Reimer commented Jun 3, 2022

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
Copy link
Owner

M-Reimer commented Jun 4, 2022

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

@MChrisp
Copy link
Author

MChrisp commented Jun 4, 2022

Thanks. Got it.

@M-Reimer
Copy link
Owner

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.

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

No branches or pull requests

2 participants