2016-03-30 14:20:27 +02:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script>
|
|
|
|
onload = function() {
|
|
|
|
const ipc= require('electron').ipcRenderer;
|
|
|
|
|
|
|
|
var webview = document.getElementById("glowingbear");
|
|
|
|
|
|
|
|
var handleconsole = function(e) {
|
|
|
|
if(e.message.substring(0,7) == "badge: ") {
|
|
|
|
ipc.send('badge', e.message.substring(7));
|
|
|
|
}else{
|
|
|
|
console.log("webview: " + e.message);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var handlenewwindow = function(e) {
|
|
|
|
require('shell').openExternal(e.url);
|
|
|
|
}
|
|
|
|
var handletitleset = function(e) {
|
|
|
|
document.title = e.title;
|
|
|
|
}
|
|
|
|
webview.addEventListener("console-message", handleconsole);
|
|
|
|
webview.addEventListener("new-window", handlenewwindow);
|
|
|
|
webview.addEventListener("page-title-set", handletitleset);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2016-04-01 21:50:34 +02:00
|
|
|
<webview preload="electron-globals.js" id="glowingbear" src="index.html" style="position:fixed; top:0; left:0; bottom:0; right:0;"></webview>
|
2016-03-30 14:20:27 +02:00
|
|
|
</body>
|
|
|
|
</html>
|