-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhidden.html
78 lines (72 loc) · 1.7 KB
/
hidden.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<title>Hidden Scraper</title>
</head>
<body>
<div class="warning">
<h1>Warning</h1>
<p>This page is hidden and should not be accessed directly.</p>
<p>If you are here you know what you need to do </p>
<p>Do not close this window by any means because it will stop the scraping process and break the app</p>
</div>
</body>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
.warning {
padding: 20px;
background-color: #f44336;
color: white;
text-align: center;
}
.warning h1 {
margin: 0;
font-size: 24px;
}
.warning p {
margin: 10px 0;
}
</style>
<script>
class Response {
constructor(statusCode, body, contentType, headers) {
this.statusCode = statusCode;
this.body = body;
this.contentType = contentType;
this.headers = headers || {};
}
json() {
return JSON.parse(this.body);
}
}
</script>
<script>
async function request(url, method, headers = {}, body = null) {
const fetchResp = await fetch(url, {
method,
headers,
body
});
const responseHeaders = {};
fetchResp.headers.forEach((value, key) => {
responseHeaders[key] = value;
});
return new Response(
fetchResp.status,
await fetchResp.text(),
fetchResp.headers.get("content-type") || '',
responseHeaders
);
};
</script>
<script>
async function callWebview(url, method, headers, body) {
let response = await window.ipcRenderer.invoke('webview', { url, method, headers, body });
return response;
}
</script>
</html>