Skip to content

LinkUtils custom application launcher protocols #1284

Open
@jonassorgenfrei

Description

@jonassorgenfrei

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 :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions