Rob--W / open-in-browser

A browser extension that offers the ability to open files directly in the browser instead of downloading them.
Other
83 stars 15 forks source link

Open in Browser doesn't open on Google Slides - Downloads as PDF #72

Open softmoth opened 3 years ago

softmoth commented 3 years ago

Using Open in Browser version 2.11 on Firefox 85.0.1 on Fedora Linux. Normally opening PDFs works fine, but on Google Slides it does not present any dialog box.

To reproduce:

I don't know what kind of magic Google Slides is doing, and how that's interfering with Open in Browser.

I have all permissions available to the Open in Browser extension, and I also allowed it to run in private windows just in case.

Rob--W commented 3 years ago

Google Slides "downloads" by loading the document in a child frame. When I inspect the network traffic and put a breakpoint on the trigger of the PDF request, I see that the following HTML is appended to the document:

"<iframe src="/presentation/d/1zikdCMTRrIo1-t83EkK2vlqO_bqm8zjIQi4HuPYj3I0/export/pdf?id=1zikdCMTRrIo1-t83EkK2vlqO_bqm8zjIQi4HuPYj3I0&amp;pageid=p" style="display: none;"></iframe>"

... so the document is loaded in the browser, except the frame is hidden.

softmoth commented 3 years ago

I assume then that Firefox decides to not display its Open with... dialog when the content is hidden. It could be considered a bug in Firefox, or it could be a feature. Either way, I guess you can close this unless you feel like adding a workaround. Google Sheets is the only site I've noticed this problem on so far, and for my needs I'm OK with disabling the plugin momentarily for this one use case. Thanks for this plugin, it's very helpful!

climbTheStairs commented 9 months ago

This also occurs when attempting to download PDFs in Google Drive. Setting application/pdf to Open in browser as application/pdf makes this unusable. Does anyone know of any workarounds?