Shubham-Kumar-2000 / protocol-registry

This module allows you to set custom protocol handler for your nodejs app.
MIT License
65 stars 14 forks source link

Issue when setting another protocol than the demo #42

Closed quentinlamamy closed 11 months ago

quentinlamamy commented 1 year ago

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
Shubham-Kumar-2000 commented 1 year ago

Can you check that if this protocol is registered by any other app on the same system?