Open Bug 1818460 Opened 2 years ago Updated 1 year ago

[Snap] view_source.editor stopped working

Categories

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

Firefox 110
defect

Tracking

()

UNCONFIRMED

People

(Reporter: bernard4, Unassigned)

References

(Blocks 1 open bug)

Details

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

Steps to reproduce:

I am under Linux KUbuntu 22.4 LTS.
I updated my system yesterday from KUbuntu 20.4 to 22.4
I restarted my computer at least three times.
I closed all Firefox windows before restarting Firefox.
Before updating viewing the source of a file in Firefox opened Geany to view the source. Now, the source is opened in Firefox and not anymore in Geany.
I checked :
view_source.editor.orgs : -> empty
view_source.editor.external : true
view_source.editor.path : /usr/bin/geany
I tested in a Terminal than typing : /usr/bin/geany opens geany normaly.
If I select any webpage, right click, select to view the source code, it is opened in Firefox, not in Geany, as it used to be before my update.

Actual results:

As I wrote before :
I checked :
view_source.editor.orgs : -> empty
view_source.editor.external : true
view_source.editor.path : /usr/bin/geany
I tested in a Terminal than typing : /usr/bin/geany opens geany normaly.
If I select any webpage, right click, select to view the source code, it is opened in Firefox, not in Geany, as it used to be before my update.

Expected results:

The source code should be viewed in Geany, not in FireFox.

It is a downgrade, since it worked well before the upgrade.

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Gtk' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

The bug mentioned above occurs with the snap version of Firefox on KUbuntu 22.04.
I tested it on three different computers.
I removed the snap version and installed a .deb version. Search : "Firefox snap remove"
With it, Firefox works well again.
I had another bug, that the .pdf files couldn't be opened in okular. It is also resolved with the .deb version.

Blocks: snap
Priority: -- → P3
Summary: view_source.editor stopped working → [Snap] view_source.editor stopped working

Pretty sure this is related to /usr/bin/geany not being part of the snap, so you can't access it for view_source. This is a design limitation from the Snap packaging, I am unsure what we can do around that.

External viewer is called from https://searchfox.org/mozilla-central/rev/b741ddde6c678ca7025858952202d20664491555/toolkit/components/viewsource/content/viewSourceUtils.js#59 which at some point tries to start your configured editor https://searchfox.org/mozilla-central/rev/b741ddde6c678ca7025858952202d20664491555/toolkit/components/viewsource/content/viewSourceUtils.js#371 which is just going to fork() at some point https://searchfox.org/mozilla-central/rev/b741ddde6c678ca7025858952202d20664491555/xpcom/threads/nsProcessCommon.cpp#431

Tracing with strace reveals:

  • not setting up an external view_source shows no reference to /usr/bin/geany
  • setting up geany will make the process try to stat it because trying to launch it, and fail (-ENOENT)

Maybe we need to make use of the OpenFile XDG portal entry https://flatpak.github.io/xdg-desktop-portal/#gdbus-method-org-freedesktop-portal-OpenURI.OpenFile ?
Probably this cannot work because we cannot use user-configured editor

Blocks: snap-sandbox
No longer blocks: snap

I'm convinced that it's a problem with snap. Now, using Firefox installed with "sudo apt-get install firefox", everything is working well. I didn't re-test with snap.
I'm under Linux KUbuntu 22.04, using Firefox 117.0.1 (64 bits) "Mozilla Firefox for Ubuntu canonical - 1.0".

(In reply to Bernard from comment #5)

I'm convinced that it's a problem with snap.

I am unsure what you mean here, because this is explicitely what I stated earlier: the way snap sandbox works, we cannot get this feature working until "some" upstream interface is defined and pushed for that purpose. Way out the scope of the work we can do, so far.

You need to log in before you can comment on or make changes to this bug.