Skip to content

Commit 5c686f3

Browse files
committed
added scan and collect funcs
1 parent 3cf3692 commit 5c686f3

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

client/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ <h1>EPIC_Tracker</h1>
6060
you. Doing this with a browser requires permissions, but I have skipped it due to security reasons.
6161
</code>
6262

63+
<button class="optIn">OPT</button>
64+
<br>
65+
<button class="scanButton">SCAN</button>
66+
6367
<div class="copy">
6468
<p>
6569
<a href="https://github.com/ujjwal-kr/ip-sniff">&copy; ujjwal-kr</a>

client/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,23 @@ nowFetch().then(response => {
162162
console.log(e)
163163
})
164164

165+
const optIn = document.querySelector('.optIn')
166+
optIn.addEventListener('click', (e) => {
167+
e.preventDefault()
168+
collectHASH(HASH).then(resp => {console.log(resp)})
169+
.catch(e => {console.log(e)})
170+
})
171+
172+
const scanButton = document.querySelector('.scanButton')
173+
scanButton.addEventListener('click', async (e) => {
174+
await collectHASH(HASH).then(resp => {console.log(resp)})
175+
.catch(e => {console.log(e)})
176+
177+
scan().then(resp => {
178+
console.log(resp)
179+
}).catch(e => {console.log(e)})
180+
})
181+
165182
console.log("HASH:" + HASH)
166183
const hashPhrase = `Your identity HASH: ${HASH}`
167184
const ipPhrase = `Your IP address is ${data.ip}.`;

0 commit comments

Comments
 (0)