electron/spec/fixtures/pages/basic-auth.html
2015-07-24 15:33:07 +08:00

22 lines
519 B
HTML

<html>
<body>
<script src="../../static/jquery-2.0.3.min.js"></script>
<script type="text/javascript" charset="utf-8">
var ipc = require('ipc');
var port = location.search.substr("?port=".length);
$.ajax({
type: "GET",
url: "http://127.0.0.1:" + port,
headers: {
"Authorization": "Basic " + btoa("test:test")
},
success: function(result) {
ipc.sendToHost(result);
},
error: function(xhr, status, error) {
ipc.sendToHost(error);
},
});
</script>
</body>
</html>