Opening custom protocol URL doesn't work consistently in Chrome Opening custom protocol URL doesn't work consistently in Chrome google-chrome google-chrome

Opening custom protocol URL doesn't work consistently in Chrome


Application association to URI Schema

If you want to register your app to handle a specific URI Schema in Windows, then you should register it in registry. It is explained in MSDN article and Googling "Registering an Application to a URI Scheme" gives plenty of examples.

HKEY_CLASSES_ROOT/  your-protocol-name/    (Default)    "URL:your-protocol-name Protocol"    URL Protocol ""    shell/      open/        command/          (Default) PathToExecutable

Web App schema registration

You can register a custom protocol handler with Google Chrome using navigator.registerProtocolHandler (Firefox has the feature too).

navigator.registerProtocolHandler(    'web+mystuff', 'http://example.com/rph?q=%s', 'My App');

Please note, that your protocol has to start with web+. Otherwise you would get SECURITY_ERR: DOM Exception 18 error.

Or, if you are developing a Chrome App, then you can register your handlers in your manifest file.

"url_handlers": {  "view_foo_presentation": {    "matches": [      "https://www.foo.com/presentation/view/*"    ],    "title": "View Foo presentation"  }}

You can also look into the Chrome URLs (chrome://chrome-urls/) and see if you can change it in any of the settings.