Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL Protocol Handler #70

Open
SavageCore opened this issue Mar 24, 2023 · 0 comments
Open

URL Protocol Handler #70

SavageCore opened this issue Mar 24, 2023 · 0 comments

Comments

@SavageCore
Copy link

SavageCore commented Mar 24, 2023

As of now in order to support custom://url-protocols you have to create a URL Protocol key in regedit and then parse the args with global NL_ARGS, the major downside to this is the app always starts again, it cannot listen to protocol requests. Can this be extended?

Electron docs for reference.

For anyone wanting the commands for regediting they're as below:

const path = NL_PATH.replace(/\//g, '\\') // Convert path to backslashes for Windows
const filePath = path + '\\demo-app-win_x64.exe'

const {exitCode} = await Neutralino.os.execCommand('reg add HKEY_CLASSES_ROOT\\custom /v "URL Protocol" /t REG_SZ /f')
if (exitCode === 1) {
  // console.log('Failed to install registry keys. Please run as administrator.')
  await Neutralino.app.exit(1)
}
await Neutralino.os.execCommand(`reg add HKEY_CLASSES_ROOT\\custom \\shell\\open\\command /f /ve /d ""${filePath}" "%1"" /t REG_SZ`)

Edit: Sorry just saw neutralinojs/neutralinojs#1044, not sure which repo this request belongs in!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant