My web app generates clickable URLs like the following when an error occurs:
subl://open?url=file://%2Fusr%2Flocal%2Fwebenginex%2Fclass%2Fmodels%2Fwxclient.php&line=123
When I click it I get this prompt:
Clicking "Launch Application" does nothing. I want it to open Sublime Text as intended. How can I configure that?
To register custom protocol handler in chrome
1. Create the desktop file
Create the file
/usr/share/applications/sublime-handler.desktop
2. Update the MIME-types database
3. Create the handler file
Create the file
/usr/share/handlers/sublime-handler
Make it executable:
4. Register mime-type handler
5. Profit
Now you can open links with custom protocols from chrome via custom applications, example:
6. Modify
It can be ported for using with the different IDE, for example
phpstorm
I am pretty much summarizing this and making it more copy-pastable...
Create the Sublime URL Parser file '/usr/local/bin/subl-url-parser':
Make it executable, and symlink it to "subl-url-handler":
Create (or update) the desktop file ' /usr/share/applications/sublime-handler.desktop' to use your new URL parser via 'subl-url-handler':
Update the databse:
NB: This assumes that you have a
sublime
in your$PATH
and not justsubl
, as I do. If not, you can make one like this: