Workspace.on('url-menu') method
Workspace › on(‘url-menu’)
Official
Triggered when the user opens the context menu on an external URL.Signature:
on(name: "url-menu", callback: (menu: Menu, url: string) => unknown, ctx?: unknown): EventRefParameters:
| Parameter | Type | Description |
|---|---|---|
| name | "url-menu" | Should be 'url-menu'. |
| callback | (menu: Menu, url: string) => unknown | The callback function. |
| ctx? | unknown | The context passed as this to the callback function. |
Returns: EventRef — The event reference.
Example:
app.workspace.on('url-menu', (menu, url) => { console.log(menu, url);});