On OSX when adding a new protocol (after setting previously another with your code example)
const ProtocolRegistry = require("protocol-registry");
console.log("Registering...");
// Registers the Protocol
ProtocolRegistry.register({
protocol: "toto", // sets protocol for your command , testproto://**
command: `/usr/local/bin/node ${path.join(__dirname, "./tester.js")} $_URL_`, // this will be executed with a extra argument %url from which it was initiated
override: true, // Use this with caution as it will destroy all previous Registrations on this protocol
terminal: true, // Use this to run your command inside a terminal
script: false,
scriptName: 'my-custom-script-name' // Custom script name.
}).then(async () => {
console.log("Successfully registered");
});
produce
Registering...
/Users/quentinlamamy/dev/cafeine/customProtocol/node_modules/protocol-registry/src/macos/index.js:144
throw new Error(scriptResult.stderr);
^
Error: .: replacing existing signature
.: replacing existing signature
at Object.register (/Users/quentinlamamy/dev/cafeine/customProtocol/node_modules/protocol-registry/src/macos/index.js:144:19)
Node.js v20.0.0
On OSX when adding a new protocol (after setting previously another with your code example)
produce