アプリ内のページ遷移は許可する

This commit is contained in:
Yuya Ochiai
2015-10-14 21:05:40 +09:00
parent 3d20c32a3d
commit 178545d7db

View File

@@ -78,6 +78,9 @@ app.on('ready', function() {
// Deny drag&drop navigation in mainWindow. // Deny drag&drop navigation in mainWindow.
// Drag&drop is allowed in webview of index.html. // Drag&drop is allowed in webview of index.html.
mainWindow.webContents.on('will-navigate', function(event, url){ mainWindow.webContents.on('will-navigate', function(event, url){
var index = url.indexOf('file://' + __dirname);
if(index != 0){
event.preventDefault(); event.preventDefault();
}
}); });
}); });