Add menu "Clear Cache and Reload"
This commit is contained in:
@@ -61,8 +61,20 @@ var createTemplate = function(mainWindow) {
|
|||||||
label: 'Reload',
|
label: 'Reload',
|
||||||
accelerator: 'CmdOrCtrl+R',
|
accelerator: 'CmdOrCtrl+R',
|
||||||
click: function(item, focusedWindow) {
|
click: function(item, focusedWindow) {
|
||||||
if (focusedWindow)
|
if (focusedWindow) {
|
||||||
focusedWindow.reload();
|
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',
|
label: 'Toggle Full Screen',
|
||||||
|
Reference in New Issue
Block a user