# Add entries to the filebrowser contextmenu

**URL:** <https://discourse.jupyter.org/t/add-entries-to-the-filebrowser-contextmenu/1651>\
**Category:** JupyterLab\
**Created:** [July 13, 2019, 3:51pm UTC](https://discourse.jupyter.org/t/add-entries-to-the-filebrowser-contextmenu/1651 "2019-07-13T15:51:51Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jtp](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/jtp/32/19100_2.png) [@jtp](https://discourse.jupyter.org/u/jtp)\
**Post date:** [July 13, 2019, 4:49pm UTC](https://discourse.jupyter.org/t/add-entries-to-the-filebrowser-contextmenu/1651/2 "2019-07-13T16:49:16Z")

</div>

@miguelmarco one way to do it would be to first create the command that will trigger the file format conversion (which can be a call to as server endpoint), and then add it to the context menu using the following:

```auto
app.contextMenu.addItem({
    command: CommandIDs.convert, // id of your command
    selector: '.jp-DirListing-item[data-isdir="false"]',
    rank: 100
  });

```

This is using the `selectorNotDir` from JupyterLab to activate the entry on files only: [https://github.com/jupyterlab/jupyterlab/blob/621ae2a760331d08edceac31754633358a0c9018/packages/filebrowser-extension/src/index.ts#L823](https://github.com/jupyterlab/jupyterlab/blob/621ae2a760331d08edceac31754633358a0c9018/packages/filebrowser-extension/src/index.ts#L823)

You can also have a look at the source for the filebrowser extension to see how the entries are populated: [https://github.com/jupyterlab/jupyterlab/blob/621ae2a760331d08edceac31754633358a0c9018/packages/filebrowser-extension/src/index.ts](https://github.com/jupyterlab/jupyterlab/blob/621ae2a760331d08edceac31754633358a0c9018/packages/filebrowser-extension/src/index.ts)

---

_[View the full topic](https://discourse.jupyter.org/t/add-entries-to-the-filebrowser-contextmenu/1651)._
