Created
July 23, 2015 11:41
-
-
Save candidosales/b19dbdea0ae574cb8c3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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