aesqe / firefox-downloads-sidebar

A Firefox web extension that displays a list of your recent downloads in the sidebar
https://addons.mozilla.org/en-US/firefox/addon/downloads-sidebar/
MIT License
17 stars 3 forks source link

Drag & Drop downloads into a tabbar or main window? #5

Closed ervasive closed 6 years ago

ervasive commented 6 years ago

Hi there, thank you for the handy little addon.

Is it possible to add the functionality that would allow us to drag a downloaded file from a sidebar list onto a currently active window or as a new tab?

Currently, it is possible with "Show all downloads" window, would be pretty helpful to have similar behavior with a sidebar as well.

Thank you.

josalhor commented 6 years ago

Hi,

I don't think that's possible. I've spent a few hours looking at it and I don't think that's achievable with the current API. Whenever I try to set up an img as draggable a Content Security Policy blocks me:

Content Security Policy: The page's settings blocked the loading of a resource at self ("script-src"). Source: ondragstart attribute on IMG element.

Keep in mind that doesn't make it impossible, that makes it impossible using the sidebar.

I believe if it instead of using the sidebar it injected the HTML and JS into every website (or however that is done with other addons) that could maybe still be possible.

But of course, doing that is out of the scope of the project as it would require to rewrite all or most of the addon.

@aesqe Could you take a look at it?

Edit: after looking at little bit more at the documentation it seems like I jumped way too soon claiming this is not possible. I'm still looking into it.

aesqe commented 6 years ago

This is currently not possible, sorry (same as https://github.com/aesqe/firefox-downloads-sidebar/issues/10)...