shivaprsd / doqment

Mozilla's HTML5 PDF Viewer with Reader-mode add-on. 📖
https://shivaprsd.github.io/doqment/src/pdfjs/web/viewer.html
MIT License
43 stars 1 forks source link

[Firefox] Extension breaks the Print/Download feature of Google Docs suite #10

Closed litoj closed 8 months ago

litoj commented 10 months ago

I needed to download a pdf of a google docs presentation. It took me a while to think about disabling this plugin, but unfortunately that turned out to be the solution.

Edit: I tried changing the default behaviour on pdfs but whether set to open or download it wouldn't work with the plugin enabled either way.

shivaprsd commented 10 months ago

@JosefLitos Did you try the Download/Save button on the toolbar? This one:

Screenshot 2023-11-30 at 4 28 18 PM

It should download the currently opened PDF (the default behaviour should be set to something other than open for this to work). Can you tell me the behaviour when you press that?

litoj commented 10 months ago

I apologize for not providing full context. The issue is that the download action is different from the open action and trying to download a pdf does nothing - no download, no new tab with the pdf.

Also, I have an issue of the tab disappearing after I close ff and open it again. It ends up in my history but isn't restored automatically (as set by "restore tabs on startup").

Edit: clicking the download button for a normally opened pdf does download it, but also opens a new doqment tab with file param as "/pages/Try Again". Default behaviour is set to "open" though. Download through the builtin pdf-viewer just downloads the pdf without trying to open it again, and also asks for the location. This is just an observation, I do not know if replicating the builtin behaviour is even possible.

shivaprsd commented 10 months ago

I understood the issue now. I was able to reproduce this bug. Basically File => Download => PDF in Google Docs fails without any effect. The bug affects not just Docs, but also Slides, Sheets, Drives, etc., and not only just Download but also the Print action in these apps.

I have also determined the cause of the issue. This was also reported in the PDF.js repo (mozilla/pdf.js#6106). I will look in to their solution and come up with a fix. Thanks for reporting! @JosefLitos 👍🏼

shivaprsd commented 10 months ago

@JosefLitos Regarding your other queries:

I have an issue of the tab disappearing after I close ff and open it again. It ends up in my history but isn't restored automatically (as set by "restore tabs on startup").

Can you please elaborate? You mean doqment tabs disappear? I am able to restore them on startup, for PDFs on the web. Local PDFs need to be opened by drag and drop again.

clicking the download button for a normally opened pdf does download it, but also opens a new doqment tab with file param as "/pages/Try Again". Default behaviour is set to "open" though.

Yes, this is the expected behaviour. It is precisely for avoiding this that I advice to change the default behaviour from Open to something else. Then it will not open in new tab.

Download through the builtin pdf-viewer just downloads the pdf without trying to open it again, and also asks for the location. This is just an observation, I do not know if replicating the builtin behaviour is even possible.

It is possible. There is another setting for Downloads: Always ask you where to save files. These are all Firefox quirks, the built-in pdf viewer can overcome but extensions (and users) need to put up with. 🙃

shivaprsd commented 10 months ago

Fixed in 3b525a4. Next release should be soon.

shivaprsd commented 8 months ago

Thanks @JosefLitos for finding this bug! 🙂