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

Google Chrome support #70

Open Airgunster opened 3 years ago

Airgunster commented 3 years ago

Hi @Rob--W,

This project was written in 2013, in an attempt to port the functionality of the Open in Browser Firefox add-on to Chrome. However, it was never published because the only way to ask the user for a decision is to use the blocking window.showModalDialog API.

Do you know if it is now possible to build open-in-browser for Google Chrome too? I'm not sure if it is still possible to be done via blocking window.showModalDialog API or not, but I'd use it even if it is implemented with blocking window.showModalDialog API.

(I've been using open-in-browser extension in Firefox, and loved it a lot (thanks for all your work!), however now migrated to Google Chrome due to few other reasons)

Thanks in advance!

Rob--W commented 3 years ago

It's still not possible, even less so with Chrome's upcoming change of removing the blocking functionality of webRequest altogether.

The showModalDialog method has been removed from Chrome. Any synchronously blocking API is a bad fit, because it will block all network requests until the extension/user has unblocked the extension's main thread/request.

Firefox is currently the only major browser that is able to support such functionality.

Airgunster commented 3 years ago

@Rob--W, thanks for quick reply! It looks like Google Chrome is going into direction to block away all of this, which is pity :/ (but they also does not provide such functionality natively)

I wonder if it would be possible to change MIME-types on the fly in Google Chrome to try to open specific extensions (like .conf or .json) in browser, instead of downloading them via Downloads UI of the browser.