If I click “OK”, native messaging works as expected, and my decision is remembered as expected; however, I cannot find the “privacy settings” from where I am supposed to be able to change this decision. Where are they? The only way I know to get the prompt again is to change the name of the native application.
You can find an example for native messaging here, altough it is a bit of a hassle to set up, especially if you’ve never worked with extensions before.
(In addition to the given instructions, you need to make sure that “python” exists on your $PATH, e.g., apt install python-is-python3.)
As a side question, what does Firefox do to even cause this prompt? Certainly not fork/exec…
The distribution is Kubuntu 22.04. It ships Firefox via Snap by default. You can use e.g. this download and see for yourself in Virtualbox (I tested it).
As I understand the PR you linked, native messaging should currently not be implemented at all for Firefox via Flatpak and Snap? Because it does work…
Is it the same for Snap? How do I access them? (I already tried brute-force grep searches for the program names to find the corresponding files, but no luck, so I have to assume that they are encoded somehow.)
I tried this on openSUSE to figure out whether this is Kubuntu-specific (it works, no dialog), but then I realized that it doesn’t install Firefox through snap by default. Do you know of any other OS that does?
Assuming that it is Kubuntu-specific, who is responsible for building Kubuntu? How would I contact them?
I have written a shell script for quickly creating extensions to facilitate testing; I’m posting it here in case it might be of use to someone:
It takes exactly one argument, a name for the extension to use, which must match ^[a-z_]+$. (More precisely, the extension-application-pair will be named $1_test_extension and $1_test_native_application. Creating multiple native applications with different names is useful since the dialog appears only once for each. Note that the script produces output on success, but not on failure.) It places the extensions it creates in test_extensions and their native applications in test_native_applications in the user’s home directory. After running the script, navigate Firefox to about:debugging, click “This Firefox” on the left, then “Load Temporary Add-on…”. In the dialog that opens, select manifest.json in ~/test_extensions/yourname_test_extension. Click “Inspect” and switch to the “Console” tab in the window that opens. Use it to run go();. At this point, the dialog shown in the first post should open if this is the first time (though it does not force itself to the foreground for me). If you choose “OK”, got message: test should appear in the console, which indicates that the test was successful.
I believe that though Snaps are an Ubuntu/Canonical service, the Firefox Snap is built by Mozilla themselves. Since it is a containerized “universal” package, the distro itself is sort of irrelevant, much like flatpaks.
Snap have an active forum that might be better able to answer this sort of question since it probably is not be a KDE specific issue.