Add menu "Clear Cache and Reload"

This commit is contained in:
Yuya Ochiai
2016-01-06 21:32:43 +09:00
parent 718d425993
commit b49f230060

View File

@@ -61,9 +61,21 @@ var createTemplate = function(mainWindow) {
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click: function(item, focusedWindow) {
if (focusedWindow)
if (focusedWindow) {
focusedWindow.reload();
}
}
}, {
label: 'Clear Cache and Reload',
accelerator: 'Shift+CmdOrCtrl+R',
click: function(item, focusedWindow) {
// TODO: should reload the selected tab only
if (focusedWindow) {
focusedWindow.webContents.session.clearCache(function() {
focusedWindow.reload();
});
}
}
}, {
label: 'Toggle Full Screen',
accelerator: (function() {