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

LinkUtils custom application launcher protocols #1284

Open
jonassorgenfrei opened this issue Mar 17, 2023 · 1 comment
Open

LinkUtils custom application launcher protocols #1284

jonassorgenfrei opened this issue Mar 17, 2023 · 1 comment

Comments

@jonassorgenfrei
Copy link

jonassorgenfrei commented Mar 17, 2023

Hey,

we are using Zulip and are having a problem for some of our custom launcher we'd link to linkify.
The links are :// unfortunatly this will always be opened in the browser as the custom protocol is not part of the list. ["http:", "https:", "mailto:"]

Would there be an option to ad custom protocol launcher to the settings which will look like:
"protocolLaunchers": {
"": "mylauncher",
}

In https://github.com/zulip/zulip-desktop/blob/main/app/common/link-util.ts

The pseudo-code my look like:

...
if (["http:", "https:", "mailto:"].includes(url.protocol)) {
    await shell.openExternal(url.href);
} elif (procolLaunchers.includes(url.protocol)) {
    executable = procolLaunchers[url.protocol]
    command = url.pathname.replace(/^\/+/g, "") + url.search + url.hash
    
    await shell.openExternal(executable + " " + command );
}
else
....

This is an option which might gives the opertunity that users can create clickable links which e.g. open files in applications while keeping the secruity menitoned in:
// For security, indirect links to non-whitelisted protocols
// through a real web browser via a local HTML file.

As the protocolLaunchers can be configured manually.

What do you think about this, happy to help/cotnribute this with a PR if it's cool :)

@jonassorgenfrei
Copy link
Author

Actually i found out that it's way easier to just expose the whitelistedProtocol list, which i will do in a PR!

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