electron/spec/fixtures/pages/basic-auth.html

23 lines
528 B
HTML
Raw Normal View History

<html>
<body>
<script src="../../static/jquery-2.0.3.min.js"></script>
<script type="text/javascript" charset="utf-8">
2015-11-10 07:29:43 +00:00
var ipc = require('ipc-renderer');
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>