No Login Data Private Local Save

Protocol Handler Registration - Online Register URL Scheme

6
0
0
0

Protocol Handler Registration

Generate OS-level URL scheme registrations for Windows, macOS & Linux. Create custom protocol handlers like myapp:// for deep linking into your desktop application.

Configuration
://
Letters, numbers, hyphens, dots. Must start with a letter.
Full path to the application executable.
Index of icon in the .exe file (0-based). Default: 1
myapp://example
Registry File Double-click the .reg file to install on Windows
.reg Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\myapp] @="URL:MyApp Protocol" "URL Protocol"="" [HKEY_CLASSES_ROOT\myapp\DefaultIcon] @="C:\\Program Files\\MyApp\\app.exe,1" [HKEY_CLASSES_ROOT\myapp\shell] [HKEY_CLASSES_ROOT\myapp\shell\open] [HKEY_CLASSES_ROOT\myapp\shell\open\command] @="\"C:\\Program Files\\MyApp\\app.exe\" \"%1\""
Info.plist XML Add to your app's Info.plist inside <dict>
XML <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>com.example.myapp</string> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> </array> </dict> </array>
.desktop Entry Place in ~/.local/share/applications/
DESKTOP [Desktop Entry] Type=Application Name=MyApp Exec=/usr/bin/myapp %u MimeType=x-scheme-handler/myapp; NoDisplay=true Terminal=false
JavaScript navigator.registerProtocolHandler (web+ prefix only)
JS // Register web+ protocol handler (browser-based) navigator.registerProtocolHandler( 'web+myapp', 'https://example.com/handler?url=%s', 'MyApp Web Handler' ); // Detect if protocol is likely supported function detectProtocol(scheme, fallbackUrl, timeout = 2000) { return new Promise((resolve) => { const start = Date.now(); const iframe = document.createElement('iframe'); iframe.style.display = 'none'; document.body.appendChild(iframe); const timer = setTimeout(() => { document.body.removeChild(iframe); resolve(false); }, timeout); const blurHandler = () => { clearTimeout(timer); document.body.removeChild(iframe); window.removeEventListener('blur', blurHandler); resolve(true); }; window.addEventListener('blur', blurHandler); try { iframe.src = scheme + '://test'; } catch(e) { clearTimeout(timer); document.body.removeChild(iframe); resolve(false); } }); }
Test Your Protocol

Click the button below to test if the protocol handler is registered on this machine. If registered, the associated application should launch.

Manual test link: myapp://test
Frequently Asked Questions

A custom URL scheme (like myapp://) allows websites or other applications to launch your desktop application with specific parameters. When a user clicks a link with your custom scheme, the operating system looks up which application is registered to handle it and launches that app, passing the full URL. This enables deep linking — for example, slack://open opens Slack, spotify://play opens Spotify. It's widely used for OAuth callbacks, application-to-web communication, and seamless user experiences.

On Windows, protocol handlers are registered via the Windows Registry under HKEY_CLASSES_ROOT\[scheme]. You need to create registry keys that specify the URL protocol, the default icon, and the shell open command that launches your executable with the URL passed as %1. The easiest way is to create a .reg file (which this tool generates) and double-click it to merge into the registry. Administrator privileges may be required. Alternatively, your application installer can create these registry entries programmatically.

OS-level registration (Windows Registry, macOS Info.plist, Linux .desktop) allows any application on the system to handle a custom URL scheme like myapp://. This works across all browsers and applications. Web-based registration using navigator.registerProtocolHandler() only works within browsers and is restricted to schemes prefixed with web+ (e.g., web+myapp://). The web API lets a website register itself as the handler, meaning when a user clicks a web+myapp:// link, the browser navigates to your handler URL instead of launching a desktop app. Use OS-level registration for desktop apps and web API for web-to-web communication.

The simplest way is to type your protocol URL (e.g., myapp://test) directly into a browser's address bar and press Enter. If the handler is registered, your application should launch. You can also use the test button in this tool, which attempts to open the protocol link. For programmatic detection, you can use the JavaScript snippet in the "Web API" tab — it uses a combination of iframe loading and blur event detection to infer whether a protocol handler responded. Note that browsers increasingly block these detection methods for privacy reasons, so false negatives are possible.

According to RFC 3986, a URI scheme name must start with a letter (a-z, A-Z) and can be followed by any combination of letters, digits (0-9), plus signs (+), hyphens (-), and dots (.). Examples of valid schemes: myapp, my-app, com.example.app, app+v2. Avoid using schemes that conflict with well-known ones like http, https, ftp, mailto, tel, sms, etc. Also note that schemes are case-insensitive per the spec, though lowercase is the convention.

Yes, there are several security considerations: 1) Protocol hijacking — if multiple applications register the same scheme, the last one installed typically wins, which can be exploited by malware. 2) Data injection — always validate and sanitize URL parameters passed to your application; malicious websites could craft URLs with dangerous payloads. 3) Fingerprinting — websites can use protocol detection to fingerprint users by checking which applications they have installed. 4) Phishing — attackers could use familiar-looking scheme names to trick users. Always use unique, application-specific scheme names, validate all incoming URL data, and consider implementing user confirmation for sensitive actions triggered via protocol links.

Yes! Both iOS and Android support custom URL schemes natively. On iOS, you register custom schemes in your app's Info.plist (similar to macOS) using CFBundleURLSchemes. On Android, you define intent filters in your AndroidManifest.xml with <data android:scheme="myapp"/>. Starting with Android 12 and iOS 14+, both platforms encourage using Universal Links (iOS) and App Links (Android) over custom schemes, as they provide better security (domain verification) and fallback behavior when the app isn't installed.