Closed Bug 1669282 Opened 4 years ago Closed 2 years ago

[flatpak/snap] Navigating to localhost:port causes Firefox to ask to choose an application

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 81
defect

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox81 --- wontfix
firefox82 --- wontfix
firefox83 --- wontfix
firefox84 --- wontfix
firefox85 --- wontfix
firefox100 --- fixed

People

(Reporter: yoasif, Assigned: jhorak)

References

Details

Attachments

(3 files)

Attached image vr811ei4kar51.png

From https://www.reddit.com/r/firefox/comments/j5l0ll/why_cant_firefox_open_ports_normally_why_does/

Note: I cannot reproduce this on GNOME or XFCE on Ubuntu, or in Windows.

Steps to reproduce:

  1. Download KDE Neon user edition https://neon.kde.org/download
  2. Start KDE Neon in a VM
  3. Open Firefox
  4. Navigate to localhost:8000

What happens:

Firefox asks user to choose an application to launch "localhost" links.

Expected result:

Firefox should try to resolve the entered query as http://localhost:8000 and fail.

Happens on kde manjaro too

[Tracking Requested - why for this release]:

Component: Address Bar → Widget: Gtk
Product: Firefox → Core
Priority: -- → P3
Summary: Navigating to localhost:port causes Firefox to ask to choose an application → [KDE] Navigating to localhost:port causes Firefox to ask to choose an application

It seems that the KDE is setting GTK_USE_PORTAL=1 environment variable to use KDE native dialogs. This is intended to be used only for Flatpak because Firefox cannot get list of supported applications installed on the system the System handler just accepts all schemes just in case the system has a support for it. It's rather dumb, but I don't know how to handle it better ATM. Not using system handler would make the magnet: telegram: etc schemes fail to open.

Try to run Firefox with export GTK_USE_PORTAL=0. But it might be reset by the launch script.

Btw I've filled this feature request for the portal: https://github.com/flatpak/xdg-desktop-portal-gtk/issues/330

We need to disable current scheme handling under flatpak because it expects
there's system handler for all schemes (which is wrong for example for 'localhost')
until there's a flatpak portal which provides if system has a handler for specific
scheme.

Assignee: nobody → jhorak
Status: NEW → ASSIGNED
Pushed by smolnar@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c37b45058138
Disable scheme handlers in flatpak until portal is provided; r=stransky DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Does this need a Beta approval request?

Too late for 84 at this point.

Flags: needinfo?(jhorak)
QA Whiteboard: [qa-85b-p2]

Alternatively, could you treat "localhost:port" as a special case and automatically treat it as though it is automatically destined for Firefox without looping through the OS's registered protocol handler, so that it does not flow through to xdg-open at all?

I acknowledge this is an assumption without any research, but surely nobody types in localhost:9090 into Firefox and expects another completely different application to pop-up

I would suggest that completely disabling all protocol handlers in Firefox-in-flatpak was an overly broad solution, causing https://bugzilla.mozilla.org/show_bug.cgi?id=1688966 , and hopefully we can come up with a focused alternative

[comment for wrong bug]

Regressions: 1688966

Backed out in 85.0.1 for causing bug 1688966.

Landing the backout in 87 as well due to that regression
https://hg.mozilla.org/integration/autoland/rev/68c881bd1ac0

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 85 Branch → ---

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:jhorak, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(stransky)
Flags: needinfo?(jhorak)

The patch landed and had to be backed out.

Flags: needinfo?(stransky)
Flags: needinfo?(jhorak)

Experiencing this on Manjaro's stable/testing/unstable branches, and Arch, without using the Firefox Flatpak/Snap.

I can say that I also have not done research but I am absolutely blown away every single time Firefox asks me what I want to do with "localhost:8384". Further, isn't basically every distro shipping with XDK Portals configured correctly, thus meaning this affects nearly every Linux user? ...

What do you

Summary: [KDE] Navigating to localhost:port causes Firefox to ask to choose an application → [flatpak/snap] Navigating to localhost:port causes Firefox to ask to choose an application
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4aca9eb046e5
Make flatpak/snap avoid handling uri schemes that look like loopback hosts. r=jhorak
Status: REOPENED → RESOLVED
Closed: 3 years ago2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: