File size: 432 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const path = require( 'node:path' );
const { app } = require( 'electron' );
const Config = require( '../../lib/config' );

module.exports = function () {
	const protocol = Config.protocol;
	if ( process.defaultApp ) {
		if ( process.argv.length >= 2 ) {
			app.setAsDefaultProtocolClient( protocol, process.execPath, [
				path.resolve( process.argv[ 1 ] ),
			] );
		}
	} else {
		app.setAsDefaultProtocolClient( protocol );
	}
};