2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-17 11:22:20 +00:00

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('minwidth', '100');
webView.setAttribute('minheight', '100'); webView.setAttribute('minheight', '100');
if (appArgs.userAgent) {
webView.addEventListener('dom-ready', function() { 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) { webView.addEventListener('new-window', function(e) {
require('shell').openExternal(e.url); require('shell').openExternal(e.url);
}); });

View File

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