mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-02-02 19:58:24 +00:00
Dev tools should show for the webview
instead of the main browser window
This commit is contained in:
parent
b5ed2277bd
commit
b9d0f70580
@ -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);
|
||||||
});
|
});
|
||||||
|
@ -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');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user