implement Demo App sections: Dialogs, Menu, Tray, Shell, CrashHang, Notification, Shortcuts etc. Fix some API bugs and implement GlobalShortcut-, Shell- and WebContents-API.

This commit is contained in:
Gregor Biswanger
2017-10-21 04:37:01 +02:00
parent 9046f6ca25
commit 248ddde82b
61 changed files with 2505 additions and 57 deletions

View File

@@ -0,0 +1,31 @@
"use strict";
exports.__esModule = true;
var electron_1 = require("electron");
module.exports = function (socket) {
socket.on('register-webContents-crashed', function (id) {
var browserWindow = getWindowById(id);
browserWindow.webContents.removeAllListeners('crashed');
browserWindow.webContents.on('crashed', function (event, killed) {
socket.emit('webContents-crashed' + id, killed);
});
});
socket.on('register-webContents-didFinishLoad', function (id) {
var browserWindow = getWindowById(id);
browserWindow.webContents.removeAllListeners('did-finish-load');
browserWindow.webContents.on('did-finish-load', function () {
socket.emit('webContents-didFinishLoad' + id);
});
});
socket.on('webContentsOpenDevTools', function (id, options) {
if (options) {
getWindowById(id).webContents.openDevTools(options);
}
else {
getWindowById(id).webContents.openDevTools();
}
});
function getWindowById(id) {
return electron_1.BrowserWindow.fromId(id);
}
};
//# sourceMappingURL=webContents.js.map