Register and handle custom URL protocols (deep linking) across platforms for Electron applications
Register and handle custom URL protocols (deep linking) for Electron applications across Windows, macOS, and Linux. This skill enables apps to respond to custom URL schemes like myapp:// for deep linking and inter-application communication.
{
"type": "object",
"properties": {
"projectPath": {
"type": "string",
"description": "Path to the Electron project root"
},
"protocols": {
"type": "array",
"items": {
"type": "object",
"properties": {
"scheme": { "type": "string", "description": "Protocol scheme (e.g., 'myapp')" },
"name": { "type": "string", "description": "Human-readable name" },
"role": { "enum": ["Viewer", "Editor", "Shell", "None"], "default": "Viewer" }
},
"required": ["scheme", "name"]
}
},
"singleInstance": {
"type": "boolean",
"description": "Enforce single instance with protocol relay",
"default": true
},
"securityOptions": {
"type": "object",
"properties": {
"validateUrls": { "type": "boolean", "default": true },
"allowedHosts": { "type": "array", "items": { "type": "string" } },
"sanitizeParams": { "type": "boolean", "default": true }
}
},
"targetPlatforms": {
"type": "array",
"items": { "enum": ["win32", "darwin", "linux"] }
}
},
"required": ["projectPath", "protocols"]
}
{
"type": "object",
"properties": {
"success": { "type": "boolean" },
"files": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": { "type": "string" },
"description": { "type": "string" }
}
}
},
"configuration": {
"type": "object",
"properties": {
"electronBuilder": { "type": "object" },
"packageJson": { "type": "object" }
}
},
"testUrls": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["success"]
}
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>My App Protocol</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
</dict>
</array>
// electron-builder.yml