Custom protocol handlers Linux, Centos 7 for chrome Custom protocol handlers Linux, Centos 7 for chrome google-chrome google-chrome

Custom protocol handlers Linux, Centos 7 for chrome


To add protocol handler myapp:// you need to add file myapp.desktop to ~/.local/share/applications.It looks like this:

[Desktop Entry]Name=myappExec=/path/to/your/program %uType=ApplicationTerminal=falseMimeType=x-scheme-handler/myapp;

Exec and MimeType are very important.

Then you need to add line

x-scheme-handler/myapp=myapp.desktop

to file ~/.local/share/applications/mimeapps.list under [Default Applications]

At the end you will probably need to type command:

update-desktop-database ~/.local/share/applications

For me it was working on all browsers.