Closed bolte-io closed 3 years ago
Can you share your registration code?
const path = require('path');
const ProtocolRegistry = require('protocol-registry');
ProtocolRegistry.register({
protocol: 'testproto',
command: `node ${path.join(__dirname, './index.js')} "$_URL_"`,
override: true,
terminal: true,
script: true
}).then(async () => {
console.log('Success');
});
There was bug in script: true
which is fixed in the current version of the codebase on github.
It has been tested in windows, but testing of macos and linux are pending post which it will be live in npm.
Works now with the changes you made.
Additional question. Is it secure in terms of malformed URLs being able to execute code on the target machine?
As from the module we don't provide any validation of url. You need to implement that on your own.
We have added a efficient example to extract data from urls and verify them. In commit : 2b400535cda93176780221f5b6ccfaeb78c755b8
New npm version live closing this issue.
Hey,
Given the URL: testproto://test/example?var1=hello&var2=world And parsing the arguments passed to my JS, the below happens...
I am looking for clarification as to examples of correctly formatted URLs. Trying to figure out how I would go about parsing these into commands, and sub command and pass variables into my application via URL query.
Can you clarify the URL schema so I know what my options are please?