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


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

Firefox 82



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


(Reporter: olivier, Assigned: olivier)


(Blocks 1 open bug)



(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 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, 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


Actual results:

This opens the requested URL ( 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.


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?


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?


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

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
Check for the actual snap name when detecting whether running as a snap. r=stransky
Flags: needinfo?(stransky)
Flags: needinfo?(olivier)
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.