Skip to content

Instantly share code, notes, and snippets.

@candidosales
Created July 23, 2015 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save candidosales/b19dbdea0ae574cb8c3c to your computer and use it in GitHub Desktop.
Save candidosales/b19dbdea0ae574cb8c3c to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>Palitagem</title>
</head>
<body>
<webview id="foo" src="http://localhost:81/registro-chamadas/autenticacao?u=043250663&d=VIKSTARSP" autosize="on" style="position:fixed;top:0;left:0;right:0;bottom:0" nodeintegration></webview>
<script>
var userName = process.env.USERNAME,
domain = process.env.USERDOMAIN,
palitagemRef = process.env.PALITAGEM_REF || "172.30.5.123",
webview = document.getElementById("foo"),
ipc = require("ipc");
webview.addEventListener("dom-ready", function () {
webview.openDevTools();
webview.addEventListener("ipc-message", function (event) {
console.log("ipc-message",event);
switch (event.channel) {
case "screenshot.webview":
console.log("screenshot webview -> electron");
ipc.send("screenshot.electron",event.args[0]);
break;
}
});
});
ipc.on("screenshot.final", function (blob, filename, filetype) {
console.log("screenshot webview -> guest");
webview.send("screenshot.final", blob, filename, filetype);
});
ipc.on("screenshot.error", function (err) {
console.log("[read SS pey] ", err);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment