Firefox is run with GTK_USE_PORTAL=0.
Console output:
Extension error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND) resource://gre/modules/Extension.jsm:466 :: readJSON/</<@resource://gre/modules/Extension.jsm:466:18
onStopRequest@resource://gre/modules/NetUtil.jsm:123:17
1564594967521 addons.xpi WARN Exception running bootstrap method startup on [email protected]: Error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND)(resource://gre/modules/Extension.jsm:466:18) JS Stack trace: readJSON/</<@Extension.jsm:466:18
[email protected]:123:17
Extension error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND) resource://gre/modules/Extension.jsm:466 :: readJSON/</<@resource://gre/modules/Extension.jsm:466:18
onStopRequest@resource://gre/modules/NetUtil.jsm:123:17
1564594967524 addons.xpi WARN Exception running bootstrap method startup on [email protected]: Error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND)(resource://gre/modules/Extension.jsm:466:18) JS Stack trace: readJSON/</<@Extension.jsm:466:18
[email protected]:123:17
Extension error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND) resource://gre/modules/Extension.jsm:466 :: readJSON/</<@resource://gre/modules/Extension.jsm:466:18
onStopRequest@resource://gre/modules/NetUtil.jsm:123:17
1564594967527 addons.xpi WARN Exception running bootstrap method startup on [email protected]: Error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND)(resource://gre/modules/Extension.jsm:466:18) JS Stack trace: readJSON/</<@Extension.jsm:466:18
[email protected]:123:17
Extension error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND) resource://gre/modules/Extension.jsm:466 :: readJSON/</<@resource://gre/modules/Extension.jsm:466:18
onStopRequest@resource://gre/modules/NetUtil.jsm:123:17
1564594967529 addons.xpi WARN Exception running bootstrap method startup on [email protected]: Error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND)(resource://gre/modules/Extension.jsm:466:18) JS Stack trace: readJSON/</<@Extension.jsm:466:18
[email protected]:123:17
Extension error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND) resource://gre/modules/Extension.jsm:466 :: readJSON/</<@resource://gre/modules/Extension.jsm:466:18
onStopRequest@resource://gre/modules/NetUtil.jsm:123:17
1564594967531 addons.xpi WARN Exception running bootstrap method startup on [email protected]: Error: Error while loading 'jar:file:///nix/store/wflrb79xhkl5gx7sxm9si3bpf48k0dbq-firefox-unwrapped-67.0/lib/firefox/browser/features/[email protected]!/manifest.json' (NS_ERROR_FILE_NOT_FOUND)(resource://gre/modules/Extension.jsm:466:18) JS Stack trace: readJSON/</<@Extension.jsm:466:18
[email protected]:123:17
Disabling it asking this should quiet the issue until it's resolved.
I can confirm that the associations are at least correct.
So I guess they should be doing the same as for snap?
In this case, I noticed that doing
optional cfg.gtkUsePortal "1";
will still return an empty list so it ends up doing
export GTK_USE_PORTAL=
By using lib.mkIf we can prevent that.
I don't think that's quite it. There seems to be a fundamental confusion; the flatpak docs say that:
Portals are the framework for securely accessing resources from outside an application sandbox.
But of course you don't need to be running in a sandbox to use the functionality they provide. Yet firefox is using the presence of GTK_USE_PORTAL to determine if the application is running in a flatpak container. This isn't going to work if people use portals for other reasons.
What they _should_ be doing, I think, is the same as for snap, if the program is running in a flatpak.
They probably also need a more fine-grained way to instruct firefox to use a portal for the file chooser without affecting other functionality:
Setting GTK_USER_PORTAL=1 [sic] to get KDE native dialog is generally not a good idea. The GTK_USER_PORTAL variable is used to detect if the app runs as a flatpak and that means it cannot use the native print dialog and look for mimetype handlers in Firefox.
(Here's why it doesn't actually check the value of GTK_USE_PORTAL:
https://dxr.mozilla.org/mozilla-central/rev/5f8aeb02af2259acfceed9e1abe987849fbb67ca/toolkit/system/gnome/nsGIOService.cpp#35)
I don't think that's quite it.
That doesn't fix the issue in firefox, in the report this behavior was triggered even if the variable was set in the environment. And in general that probably shouldn't be happening so I fixed that.
Not sure what you mean, but I wasn't disagreeing with the mkIf thing, just bouncing ideas about how Firefox could improve their behaviour. I'll take the suggestions upstream if I find the time.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
I still have this issue. Is there a workaround?
I am experiencing this issue atm. Every link I click tries to open in firefox but ends up doing nothing and firefox prompts me to set it as the default browser on every run.