mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-17 16:29:42 -04:00
Add contextmenu to Electron app
Former-commit-id: 48c745f3fc3c5f57536b0424db103910759f3645 [formerly 70a7eae3da801be3f77df32df1a6fd82b0466557 [formerly c17a331bd6b219e787d66773a30150469cf9bb29]] Former-commit-id: 6f5442d908bfb8cb6d9d44052ca5a4c079209775 Former-commit-id: da98de6b149ab6a85feb7439d19a472ca01c715f
This commit is contained in:
parent
8b76a3aaae
commit
be39e18a9e
29
main.js
29
main.js
@ -7,6 +7,35 @@ const {
|
|||||||
} = require('electron');
|
} = require('electron');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
|
const contextMenu = require('electron-context-menu');
|
||||||
|
|
||||||
|
contextMenu({
|
||||||
|
labels: {
|
||||||
|
cut: 'Cut',
|
||||||
|
copy: 'Copy',
|
||||||
|
paste: 'Paste',
|
||||||
|
save: 'Save Image',
|
||||||
|
saveImageAs: 'Save Image As…',
|
||||||
|
copyLink: 'Copy Link',
|
||||||
|
saveLinkAs: 'Save Link As…',
|
||||||
|
inspect: 'Inspect Element'
|
||||||
|
},
|
||||||
|
prepend: () => { },
|
||||||
|
append: () => { },
|
||||||
|
showCopyImageAddress: true,
|
||||||
|
showSaveImageAs: true,
|
||||||
|
showInspectElement: true,
|
||||||
|
showSaveLinkAs: true,
|
||||||
|
cut: true,
|
||||||
|
copy: true,
|
||||||
|
paste: true,
|
||||||
|
save: true,
|
||||||
|
saveImageAs: true,
|
||||||
|
copyLink: true,
|
||||||
|
saveLinkAs: true,
|
||||||
|
inspect: true
|
||||||
|
});
|
||||||
|
|
||||||
// This is used to set capabilities of the app: protocol in onready event below
|
// This is used to set capabilities of the app: protocol in onready event below
|
||||||
// protocol.registerSchemesAsPrivileged([{
|
// protocol.registerSchemesAsPrivileged([{
|
||||||
// scheme: 'app',
|
// scheme: 'app',
|
||||||
|
@ -86,8 +86,7 @@
|
|||||||
"electron-packager": "^15.2.0"
|
"electron-packager": "^15.2.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/fs-extra": "^9.0.11"
|
"@types/fs-extra": "^9.0.11",
|
||||||
|
"electron-context-menu": "^3.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user