Skip to content

Commit 48b43f9

Browse files
authored
Add showCopyLink option (#165)
1 parent 9ed5d4b commit 48b43f9

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,13 @@ declare namespace contextMenu {
241241
*/
242242
readonly showSaveVideoAs?: boolean;
243243

244+
/**
245+
Show the `Copy Link` menu item when right-clicking on a link.
246+
247+
@default true
248+
*/
249+
readonly showCopyLink?: boolean;
250+
244251
/**
245252
Show the `Save Link As…` menu item when right-clicking on a link.
246253
@@ -325,6 +332,7 @@ declare namespace contextMenu {
325332
- `showCopyVideoAddress`
326333
- `showSaveVideo`
327334
- `showSaveVideoAs`
335+
- `showCopyLink`
328336
- `showSaveLinkAs`
329337
- `showInspectElement`
330338
- `showServices`

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const create = (win, options) => {
289289
options.showSaveVideoAs && defaultActions.saveVideoAs(),
290290
options.showCopyVideoAddress && defaultActions.copyVideoAddress(),
291291
defaultActions.separator(),
292-
defaultActions.copyLink(),
292+
options.showCopyLink !== false && defaultActions.copyLink(),
293293
options.showSaveLinkAs && defaultActions.saveLinkAs(),
294294
defaultActions.separator(),
295295
shouldShowInspectElement && defaultActions.inspect(),

readme.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ Default: `false`
199199

200200
Show the `Save Video As…` menu item when right-clicking on a video.
201201

202+
#### showCopyLink
203+
204+
Type: `boolean`\
205+
Default: `true`
206+
207+
Show the `Copy Link` menu item when right-clicking on a link.
208+
202209
#### showSaveLinkAs
203210

204211
Type: `boolean`\
@@ -285,6 +292,7 @@ The following options are ignored when `menu` is used:
285292
- `showCopyVideoAddress`
286293
- `showSaveVideo`
287294
- `showSaveVideoAs`
295+
- `showCopyLink`
288296
- `showSaveLinkAs`
289297
- `showInspectElement`
290298
- `showServices`

0 commit comments

Comments
 (0)