Skip to content

Commit eaad644

Browse files
committed
Add showSaveImageAs option
Fixes #59 Closes #61
1 parent 0cc2371 commit eaad644

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

fixture.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require('.')({
77
copy: 'Configured Copy',
88
paste: 'Configured Paste',
99
save: 'Configured Save Image',
10+
saveImageAs: 'Configured Save Image As…',
1011
copyLink: 'Configured Copy Link',
1112
inspect: 'Configured Inspect'
1213
},
@@ -25,7 +26,8 @@ require('.')({
2526
type: 'separator'
2627
}],
2728
append: () => {},
28-
showCopyImageAddress: true
29+
showCopyImageAddress: true,
30+
showSaveImageAs: true
2931
});
3032

3133
electron.app.on('ready', () => {

index.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,21 @@ function create(win, options) {
5050
click(item, win) {
5151
download(win, props.srcURL);
5252
}
53-
}, {
54-
type: 'separator'
5553
}];
54+
55+
if (options.showSaveImageAs) {
56+
menuTpl.push({
57+
id: 'saveImageAs',
58+
label: 'Save Image As…',
59+
click(item, win) {
60+
download(win, props.srcURL, {saveAs: true});
61+
}
62+
});
63+
}
64+
65+
menuTpl.push({
66+
type: 'separator'
67+
});
5668
}
5769

5870
if (props.linkURL && props.mediaType === 'none') {

readme.md

+8
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ Default: `false`
7777

7878
Show the `Copy Image Address` menu item when right-clicking on an image.
7979

80+
#### showSaveImageAs
81+
82+
Type: `boolean`<br>
83+
Default: `false`
84+
85+
Show the `Save Image As…` menu item when right-clicking on an image.
86+
8087
#### showInspectElement
8188

8289
Type: `boolean`<br>
@@ -99,6 +106,7 @@ labels: {
99106
copy: 'Configured Copy',
100107
paste: 'Configured Paste',
101108
save: 'Configured Save Image',
109+
saveImageAs: 'Configured Save Image As…'
102110
copyLink: 'Configured Copy Link',
103111
copyImageAddress: 'Configured Copy Image Address',
104112
inspect: 'Configured Inspect'

0 commit comments

Comments
 (0)