ファイルをドラッグ&ドロップした場合にmainWindowのwebContentsを遷移させず、WebViewのみが処理を実行できるようにする
This commit is contained in:
parent
64fe41da6f
commit
3d20c32a3d
6
main.js
6
main.js
|
@ -74,4 +74,10 @@ app.on('ready', function() {
|
||||||
// when you should delete the corresponding element.
|
// when you should delete the corresponding element.
|
||||||
mainWindow = null;
|
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();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue