Is there a way to remove the ‘copy shareable link’ button?

Hello everyone,

I have noticed among my users that the ‘copy shareable link’ button makes no sense in the context of JupyterHub and only confuses users.
They assume that the clicked file is shared via the link. But this is not the case. Because the link only redirects to the file if you already have one with the same name.
Hence my question. Is there a way to remove the button yourself via a config or otherwise?
Many thanks for your help in advance.

Do you mean the context menu entry? By default there is no such button unless you install an extension. Can you post a screeenshot?

1 Like

Yes, I think it is the context menu. I don’t currently know which extension it comes from.
Here is the screenshot:

You can disable specific menu entries by placing a JSON file in right format into a pre-defined location. The JupyterLab user interface is fully customisable by JSON settings; you can pre-define the settings for your users by placing per-package settings in overrides.json file in the appropriate location.

This is documented in JupyterLab documentation, in the User Guide → Interface Customization → Context Menu section:

https://jupyterlab.readthedocs.io/en/stable/user/interface_customization.html#context-menu

and more in depth in:

https://jupyterlab.readthedocs.io/en/stable/extension/extension_points.html#context-menu

The overrides.json file is documented in User Guide → Advanced Usage:

https://jupyterlab.readthedocs.io/en/stable/user/directories.html#overrides-json

2 Likes

Thanks, I was able to deactivate it successfully in the Advanced Settings Editor:

{
    "contextMenu": [
        {
            "command": "filebrowser:share-main",
            "selector": ".jp-DirListing-item[data-isdir]",
            "disabled": true
        }
    ]
}

But when I copy it to /opt/conda/share/jupyter/lab/schemas or /opt/conda/share/jupyter/lab/settings, it is not executed.

The file format of overrides.json is slightly different as it is a single file for multiple packages, so they are nested by plugin identifier. The plugin identifiers show up in the JSON settings editor.

1 Like