Skip to content

Commit

Permalink
Add showCopyLink option (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
absidue committed Oct 26, 2022
1 parent 9ed5d4b commit 48b43f9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions index.d.ts
Expand Up @@ -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.
Expand Down Expand Up @@ -325,6 +332,7 @@ declare namespace contextMenu {
- `showCopyVideoAddress`
- `showSaveVideo`
- `showSaveVideoAs`
- `showCopyLink`
- `showSaveLinkAs`
- `showInspectElement`
- `showServices`
Expand Down
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -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(),
Expand Down
8 changes: 8 additions & 0 deletions readme.md
Expand Up @@ -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`\
Expand Down Expand Up @@ -285,6 +292,7 @@ The following options are ignored when `menu` is used:
- `showCopyVideoAddress`
- `showSaveVideo`
- `showSaveVideoAs`
- `showCopyLink`
- `showSaveLinkAs`
- `showInspectElement`
- `showServices`
Expand Down

0 comments on commit 48b43f9

Please sign in to comment.