Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,30 @@

electronDl();
electronContextMenu({
showCopyImageAddress: true,
prepend(defaultActions) {
/*
TODO: Use menu option or use replacement of options (https://github.com/sindresorhus/electron-context-menu/issues/70)
See explanation for this hacky solution here: https://github.com/sindresorhus/caprine/pull/1169
*/
defaultActions.copyLink({
menu: (actions, _params, _browserWindow, dictionarySuggestions) => [

Check failure on line 48 in source/index.ts

View workflow job for this annotation

GitHub Actions / xo

The variable `_params` should be named `_parameters`. A more descriptive name will do too.

Check failure on line 48 in source/index.ts

View workflow job for this annotation

GitHub Actions / xo

The variable `_params` should be named `_parameters`. A more descriptive name will do too.
...dictionarySuggestions,
actions.separator(),
actions.learnSpelling({}),
actions.separator(),
actions.lookUpSelection({}),
actions.separator(),
actions.searchWithGoogle({}),
actions.separator(),
actions.cut({}),
actions.copy({}),
actions.paste({}),
...(is.macos ? [] : [actions.selectAll({})]),
actions.separator(),
actions.saveImageAs({}),
actions.copyImage({}),
actions.copyImageAddress({}),
actions.separator(),
actions.copyLink({
transform: stripTrackingFromUrl,
});

return [];
},
}),
actions.separator(),
...(is.development ? [actions.inspect()] : []),
],
});

app.setAppUserModelId('com.sindresorhus.caprine');
Expand Down
Loading