This repository has been archived by the owner on May 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopCookie.html
233 lines (207 loc) · 7.91 KB
/
topCookie.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!doctype html>
<html lang="en">
<head>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script src="index.js"></script>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script>
/*toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
window.$ = window.jQuery = require('jquery');
window.Bootstrap = require('bootstrap');
require( 'datatables.net-bs4' )();
const fs = require("fs");
if (!fs.existsSync("cookies.db")) {
// open database in memory
const Database = require('better-sqlite3');
const db = new Database('cookies.db', { verbose: console.log });
var sql = 'CREATE TABLE cookies(creation_utc INTEGER NOT NULL,host_key TEXT NOT NULL,name TEXT NOT NULL,value TEXT NOT NULL,path TEXT NOT NULL,expires_utc INTEGER NOT NULL,is_secure INTEGER NOT NULL,is_httponly INTEGER NOT NULL,last_access_utc INTEGER NOT NULL,has_expires INTEGER NOT NULL DEFAULT 1,is_persistent INTEGER NOT NULL DEFAULT 1,priority INTEGER NOT NULL DEFAULT 1,encrypted_value BLOB DEFAULT \'\',samesite INTEGER NOT NULL DEFAULT -1,UNIQUE (host_key, name, path))';
console.log(db.exec(sql));
const homedir = require('os').homedir();
if (process.platform === "linux") {
DBPATH = `${homedir}/.config/google-chrome/Default/Cookies`;
} else if (process.platform === "darwin") {
DBPATH = `${homedir}/Library/Application Support/Google/Chrome/Default/Cookies`;
}
fs.copyFile(DBPATH, 'cookies.db', (err) => {
if (err) {
alert(
"This application only supports OSX and Linux. Additionally, it only supports Chromium cookies. " +
"If you do not have Chromium installed or do not have any cookies, we can do nothing for you."
);
throw err
};
console.log('source.txt was copied to destination.txt');
});
console.log("DB Created.")
} else {
console.log("DB Exists.")
}
</script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.6.0/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<!-- <title>Hello, world!</title> -->
<style>
.dropbtn {
background-color: #3498DB;
color: white;
padding: 16px;
font-size: 16px;
border: none;
cursor: pointer;
}
.learnButton:hover, .learnButton:focus {
background-color: #2980B9;
}
/* Dropdown button on hover & focus */
.dropbtn:hover, .dropbtn:focus {
background-color: #2980B9;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: #f1f1f1;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #ddd}
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;}
table, th, td {
border: 1px solid black;
}
</style>
<nav id="mainNav" class="navbar navbar-expand-sm bg-dark navbar-dark">
<a class="navbar-brand" href="#">Cookie Monsterrr</a>
<!-- href contains a where the link goes to -->
<ul class="navbar-nav">
<!-- <li class="nav-item active">
<a class="nav-link" href="sample.html">Active</a>
</li> -->
<li class="nav-item">
<!-- <div id="button"> -->
<div id="learnButton">
<!-- <a class="nav-link" href="learn_more.html" target="_blank">Learn More</a> -->
<button class="dropbtn" onclick=" window.open('learn_more.html', '_blank')" >Learn More</button>
</div>
</li>
<li class="nav-item">
<div id="button">
<!-- <a class="nav-link" href="analyze.html" target="_blank">Analyze</a> -->
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn">Analyze</button>
<div id="myDropdown" class="dropdown-content">
<a href="analyze.html" target="_blank">Cookie Breakdown</a>
<a href="topCookie.html">Top 10 Cookies</a>
<a href="#">Link 3</a>
</div>
</div>
</div>
</li>
<li class="nav-item">
<button class="dropbtn" onclick=" window.open('https://github.com/utk-cs/2019fall_ant-man/blob/master/README.md', '_blank')" >Read Me</button>
</li>
</ul>
</nav>
</head>
<body>
<table id="cookies-dt" class="table table-striped table-bordered table-md" cellspacing="0" width="100%">
<thead>
<tr><legend></legend>
<th>Rank</th>
<th>Website</th>
<th>Number of Cookies</th>
</tr>
<tr>
<th>1</th>
<th>.google.com</th>
<th>35</th>
</tr>
<tr>
<th>2</th>
<th>.chrome.google.com</th>
<th>23</th>
</tr>
<tr>
<th>3</th>
<th>.youtube.com</th>
<th>17</th>
</tr>
<tr>
<th>4</th>
<th>.amazon.com</th>
<th>14</th>
</tr>
<tr>
<th>5</th>
<th>.paypal.com</th>
<th>9</th>
</tr>
<tr>
<th>6</th>
<th>.cnn.com</th>
<th>8</th>
</tr>
<tr>
<th>7</th>
<th>.tacobell.com</th>
<th>7</th>
</tr>
<tr>
<th>8</th>
<th>.reddit.com</th>
<th>7</th>
</tr>
<tr>
<th>9</th>
<th>.walmart.com</th>
<th>7</th>
</tr>
<tr>
<th>10</th>
<th>.target.com</th>
<th>4</th>
</tr>
</thead>
</table>
</body>
</html>