Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to hide the Copy Link menu item #165

Merged
merged 2 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
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`
sindresorhus marked this conversation as resolved.
Show resolved Hide resolved
- `showSaveLinkAs`
- `showInspectElement`
- `showServices`
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
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
7 changes: 7 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
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