How to open URIs using Evince flatpak?

I’m testing Fedora Silverblue and Flatpak for the first time.

I’m currently trying to see if this configuration can be adapted to work also with Fedora Silverblue and Evince installed as flatpak.

To summarize: LilyPond generates music sheets in PDF format from text files. The notation objects in the PDF can contain URI links to the exact location in the source file where these objects were created. LilyPond comes with an helper program (written in Scheme/Guile) which allows to turn these URIs - which start with a specific protocol called textedit:// - into a specific editor command line which will open a text file in a precise line and column.

While trying to make it work in Fedora Silverblue, I found two problems:

  1. Evince cannot find which program should use to open the textedit:// URI, even if I’ve added the script desktop file in ~/.local/share/flatpak/exports/share (I’ve tried also the standard ~/.local/share/application but didn’t work).

  2. Even if Evince found the program to open the URI, I wonder if the sandbox would allow to open a script. How can I check which permissions an app has? I’ve tried flatpak permissions org.gnome.Evince but it doesn’t return anything.