ファイルをドラッグ&ドロップした場合にmainWindowのwebContentsを遷移させず、WebViewのみが処理を実行できるようにする

This commit is contained in:
Yuya Ochiai 2015-10-14 00:16:42 +09:00
parent 64fe41da6f
commit 3d20c32a3d

View file

@ -74,4 +74,10 @@ app.on('ready', function() {
// when you should delete the corresponding element.
mainWindow = null;
});
// Deny drag&drop navigation in mainWindow.
// Drag&drop is allowed in webview of index.html.
mainWindow.webContents.on('will-navigate', function(event, url){
event.preventDefault();
});
});