[TOC] ## 方法 ``` protocol.registerStandardSchemes(schemes) protocol.registerServiceWorkerSchemes(schemes) protocol.registerFileProtocol(scheme, handler[, completion]) protocol.registerStringProtocol(scheme, handler[, completion]) protocol.registerHttpProtocol(scheme, handler[, completion]) protocol.unregisterProtocol(scheme[, completion]) protocol.interceptFileProtocol(scheme, handler[, completion]) protocol.interceptStringProtocol(scheme, handler[, completion]) protocol.interceptBufferProtocol(scheme, handler[, completion]) protocol.interceptHttpProtocol(scheme, handler[, completion]) protocol.uninterceptProtocol(scheme[, completion]) ``` ## 例子 ``` const {app} = require('electron'); const path =require('path'); if (!app) return; if (process.defaultApp) { if (process.argv.length >= 2) { app.setAsDefaultProtocolClient('electron-demo', process.execPath, [path.resolve(process.argv[1])]) } } else { app.setAsDefaultProtocolClient('electron-demo') } ```