Dev tools should show for the `webview` instead of the main browser window

This commit is contained in:
Jia Hao 2016-01-19 18:24:24 +08:00
parent b5ed2277bd
commit b9d0f70580
2 changed files with 8 additions and 8 deletions

View File

@ -16,12 +16,14 @@ ipc.on('params', function(event, message) {
webView.setAttribute('minwidth', '100');
webView.setAttribute('minheight', '100');
if (appArgs.userAgent) {
webView.addEventListener('dom-ready', function() {
webView.setUserAgent(appArgs.userAgent);
if (appArgs.userAgent) {
webView.setUserAgent(appArgs.userAgent);
}
if (appArgs.showDevTools) {
webView.openDevTools();
}
});
}
webView.addEventListener('new-window', function(e) {
require('shell').openExternal(e.url);
});

View File

@ -34,10 +34,8 @@ app.on('ready', function() {
}
);
if (appArgs.showDevTools) {
mainWindow.openDevTools();
}
// uncomment to show dev tools for the main window
//mainWindow.openDevTools();
mainWindow.loadUrl('file://' + __dirname + '/index.html');