Closed Bug 1674150 Opened 1 year ago Closed 1 year ago

snap detection code disables profile management even when not packaged/run as a snap

Categories

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

Firefox 82
defect

Tracking

()

RESOLVED FIXED
85 Branch
Tracking Status
firefox84 --- wontfix
firefox85 --- fixed

People

(Reporter: olivier, Assigned: olivier)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36

Steps to reproduce:

It's been reported several times on https://forum.snapcraft.io/ that when invoked from an application packaged as a classic snap¹ to open a hyperlink, firefox installed as a deb package (on Debian/Ubuntu) opens with the wrong profile by default.
This issue was investigated in https://launchpad.net/bugs/1835024, and we found out that the culprit is nsToolkitProfileService::IsSnapEnvironment()².

To reproduce the issue, ensure that a firefox window is open, then from a terminal run SNAP_NAME=foobar firefox http://example.org.

¹ https://snapcraft.io/docs/snap-confinement
² https://hg.mozilla.org/mozilla-central/file/tip/toolkit/profile/nsToolkitProfileService.cpp#l1838

Actual results:

This opens the requested URL (http://example.org) in a separate firefox window, with a different profile than that of the already open firefox window.

Expected results:

This should have opened the requested URL in a new tab in the same window that was already open.

Hi Oliver,

Thank you for your report.

I was unable to reproduce this issue on Firefox Release version 81.0 (64-bit) Mozilla Firefox for Ubuntu canonical 1.0 , but I did reproduce the issue by downloading Firefox Nightly 84.0a1 (2020-11-14) (64-bit) and installing it on a different location (for example in Desktop Folder "Nightly").

I'll add this ticket to the Widget GTK component in the hope their team can take a look at this and share their feedback.

Regards,
Virginia

Status: UNCONFIRMED → NEW
Component: Untriaged → Widget: Gtk
Ever confirmed: true
Product: Firefox → Core

(In reply to Virginia Balducci from comment #2)

I'll add this ticket to the Widget GTK component in the hope their team can take a look at this and share their feedback.

Thanks for triaging Virginia. Unfortunately the patch¹ I submitted almost a month ago hasn't received any feedback yet. How do I get someone to look at it?

¹ https://phabricator.services.mozilla.com/D95171

Olivier reached out to me on Element. I looked at the patch and it seems the owner of nsToolkitProfileService.cpp is :mossop these days[1]. Would you have the bandwidth to review this patch, Dave?

[1] https://hg.mozilla.org/mozilla-central/log/93fabad45659d172b723c9606215d3acaab54df1/toolkit/profile/nsToolkitProfileService.cpp

Assignee: nobody → olivier
Flags: needinfo?(dtownsend)

I'm Gtk peer so you can ask me to review linux/gtk code.

Priority: -- → P3

I vaguely recall some plan to distribute devedition as a separate snap at some point which this would break but it looks like that hasn't happened so this is fine. I really wish there was a sane API to detect this though, environment variable detection always seemed likely to be flakey.

Flags: needinfo?(dtownsend)
Duplicate of this bug: 1680439

Hi,
Phabricator show this bug has this tag : testing-exception-other (Please leave a comment explaining why).

Removing check-in needed because of that.

Flags: needinfo?(stransky)
Flags: needinfo?(olivier)
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/51d1c7feaa42
Check for the actual snap name when detecting whether running as a snap. r=stransky
Flags: needinfo?(stransky)
Flags: needinfo?(olivier)
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
QA Whiteboard: [qa-85b-p2]
You need to log in before you can comment on or make changes to this bug.