forked from duckduckgo/iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
trackers.html
47 lines (34 loc) · 861 Bytes
/
trackers.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
<html>
<script>
const trackers = 100;
const interval = 1000 / 10;
var token = null;
var loaded = 0;
function addTracker() {
var trackers = document.getElementById("trackers");
var counter = document.getElementById("counter");
var holder = document.createElement("div");
if (loaded++ >= 100) {
counter.innerHTML = "Done";
clearTimeout(token);
} else {
counter.innerHTML = `${loaded}`;
var script = document.createElement("script");
script.src = "//www.googletagmanager.com/gtmx.js";
holder.append(script);
}
trackers.append(holder);
}
function loadTrackers() {
token = setInterval(addTracker, interval);
}
document.addEventListener("DOMContentLoaded", loadTrackers);
</script>
<body>
Loading 100 trackers, one every 1/10 of a second.
<div id="counter">
</div>
<div id="trackers">
</div>
</body>
</html>