Always "Allow Opening File"



I use xdg-open to open a folder form a snap package. Then it will prompt a dialog to ask “Allow Opening File” from the user. Is it possible to make user need to accept once only? So that it won’t prompt again and always open.



I am also interested in this question.


This probably should be posted in the #snapd topic and perhaps someone involved with the portals support such as @jamesh could comment on if it’s possible to remember the setting


The current snap userd backend used by the sandbox xdg-open is using zenity to present the graphical prompt. So there are limits to what we can do there.

It is true that xdg-desktop-portal duplicates this functionality, so my personal preference is to focus on that as the eventual replacement.

I don’t think we are yet at the point where we can delete the code in userd, but we could have the sandbox-side xdg-open code try the portal API first and fall back if the bus reports that the portal service is not available.