アプリ内のページ遷移は許可する
This commit is contained in:
parent
3d20c32a3d
commit
178545d7db
5
main.js
5
main.js
|
@ -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){
|
||||||
event.preventDefault();
|
var index = url.indexOf('file://' + __dirname);
|
||||||
|
if(index != 0){
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue