Is there a simple way of making sure that a non-interactive shell on Linux can never execute a specific program?
Shitty applications will find impressive ways to ignore your browser defaults and try opening a chrome browser at the worst times (or even try to overwrite the default). I want to make sure that my user, from an interactive shell, can be the only way a chromium based browser ever gets executed. Is that too much to ask? Ideally in a way that prevents its automatic discoverability so it isn't even an option in context menus and so on...
@compufox that's an idea. maybe a lil shell script that asks for additional bespoke confirmation elsewise times out and does nothing would be enough...
@thufie wait what apps do that? I can totally believe that, but I haven’t personally experienced it and would like to avoid it.
As for your actual question, maybe you could write some sort of wrapper script that would get executed instead of chromium itself and redirect the URL opening to Firefox unless you add an “--actually-use-chromium” flag at the command line (in which case exec into chromium)?
I wouldn’t know how to implement that but it may be an idea to try.
And, at the risk of pointing out the obvious, apps ignoring default browser options could potentially be reported as bugs to the developers of those applications. Though it may be worth checking if your desktop is the cause of the issue (by ignoring or changing the default option to Chrome)?
I wouldn’t even consider it a viable fallback option, if you can’t use the XDG or whatever APIs to open a URL then don’t open anything.
@thufie oh also the thinking with the “actually use chromium” flag is that would allow you to both manually launch chromium (ie “chromium --actually-use-chromium” where chromium is the wrapper script and no URL is passed) and launch it from scripts or similar (and in that case probably passing a URL)
@thufie you could maybe just replace the binary with a middle man script that doesn’t do anything unless a certain parameter is passed through as well? But that might also break stuff and would require maintenance when updating…