diff --git a/index.d.ts b/index.d.ts index cef5204..f98369c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -241,6 +241,13 @@ declare namespace contextMenu { */ readonly showSaveVideoAs?: boolean; + /** + Show the `Copy Link` menu item when right-clicking on a link. + + @default true + */ + readonly showCopyLink?: boolean; + /** Show the `Save Link As…` menu item when right-clicking on a link. @@ -325,6 +332,7 @@ declare namespace contextMenu { - `showCopyVideoAddress` - `showSaveVideo` - `showSaveVideoAs` + - `showCopyLink` - `showSaveLinkAs` - `showInspectElement` - `showServices` diff --git a/index.js b/index.js index 37b11f7..6e8e551 100644 --- a/index.js +++ b/index.js @@ -289,7 +289,7 @@ const create = (win, options) => { options.showSaveVideoAs && defaultActions.saveVideoAs(), options.showCopyVideoAddress && defaultActions.copyVideoAddress(), defaultActions.separator(), - defaultActions.copyLink(), + options.showCopyLink !== false && defaultActions.copyLink(), options.showSaveLinkAs && defaultActions.saveLinkAs(), defaultActions.separator(), shouldShowInspectElement && defaultActions.inspect(), diff --git a/readme.md b/readme.md index a9da98a..be01049 100644 --- a/readme.md +++ b/readme.md @@ -199,6 +199,13 @@ Default: `false` Show the `Save Video As…` menu item when right-clicking on a video. +#### showCopyLink + +Type: `boolean`\ +Default: `true` + +Show the `Copy Link` menu item when right-clicking on a link. + #### showSaveLinkAs Type: `boolean`\ @@ -285,6 +292,7 @@ The following options are ignored when `menu` is used: - `showCopyVideoAddress` - `showSaveVideo` - `showSaveVideoAs` +- `showCopyLink` - `showSaveLinkAs` - `showInspectElement` - `showServices`