Closed Bug 1636774 Opened 5 years ago Closed 2 years ago

Drag- and dropping files in GitHub issues does not work in flatpak

Categories

(Firefox Build System :: Third Party Packaging, defect, P5)

76 Branch
x86_64
Linux
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1799380

People

(Reporter: 5i13ghzt462u, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0

Steps to reproduce:

  1. In any GitHub issue. write a reply.
  2. Drag and drop an image file.

Actual results:

First,I got some Chinese characters.

Now, reytring it, it takes multiple seconds, and then I get the file path as file:// protocol as text!

Expected results:

Drag- and drop upload.

This is specific to flathub's org.mozilla.firefox flatpak.

OS: Unspecified → Linux
Hardware: Unspecified → x86_64

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → DOM: Drag & Drop
Product: Firefox → Core

Because this bug's Severity is normal and has not been changed, and this bug's priority is -- (none,) indicating it has has not been previously triaged, the bug's Severity is being updated to -- (default, untriaged.)

Severity: normal → --

The severity field is not set for this bug.
:enndeakin, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(enndeakin)
Severity: -- → S3
Flags: needinfo?(enndeakin)
Blocks: flatpak
Severity: S3 → S4
Priority: -- → P5

The solution I found is to launch this command in the terminal:
WARNING: IT WILL RESET ALL YOUR SETTINGS AND WILL LOG OUT FROM ALL SITES. IT WILL BE RESETTED LIKE AFTER THE INSTALLATION

flatpak override --user --filesystem=home org.mozilla.firefox

(In reply to lukigno95 from comment #5)

The solution I found is to launch this command in the terminal:
WARNING: IT WILL RESET ALL YOUR SETTINGS AND WILL LOG OUT FROM ALL SITES. IT WILL BE RESETTED LIKE AFTER THE INSTALLATION

flatpak override --user --filesystem=home org.mozilla.firefox

Would be possible to add this feature at build time? I mean for the common user it's just impossible to think that can find this solution and run it in the terminal

When a file is drag-and-dropped, the compositor will send an event with a path to the file in the host.

Sandboxed applications can't read this path, since they don't have filesystem access on the host, so the reading the dropped file fails.

This requires compositors to integrate with the xdg-document-portal. There's an issue for this for sway: https://github.com/swaywm/sway/issues/6460

In the meantime, I don't think there's anything Firefox can do to support this.

flatpak override --user --filesystem=home org.mozilla.firefox

Note that this pretty much negates the usefulness of the sandbox; Firefox can read and write any file in your home (including ssh keys, etc), and alter .bashrc and friends to hijack sessions entirely.

In Firefox Drag & Drop works from files within the Download directory.

I don't think there's anything Firefox can do to support this.

Something regarding this was merged into xdg-desktop-portal in 2019:

https://github.com/flatpak/xdg-desktop-portal/issues/99#issuecomment-565043646

And it was said that Gtk4 apps should have support for this out of the box support according this comment: https://github.com/flatpak/xdg-desktop-portal/issues/99#issuecomment-565264246

So maybe it needs the same or similar logic in FF?

Component: DOM: Copy & Paste and Drag & Drop → Third Party Packaging
Product: Core → Firefox Build System

Re-triaging because this is most likely due to Flatpak's sandboxing not punching a hole for the file rather than anything DOM related.

Duplicate of this bug: 1808054
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Duplicate of bug: 1799380
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.