-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconsole2db_test.html
41 lines (38 loc) · 1.77 KB
/
console2db_test.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
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script language="javascript" src="logs2indexeddb.js"></script>
<script language="javascript">
// Extended example from https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
$(function () {
// Init and start saving console logs into IndexedDB
l2i.init(function() {// successfully initialized
l2i.on(function() {
// l2i.consoles.original('--- All further logs will be saved in IndexedDB database ---');
console.log('one one');
console.log('two');
console.log('three');
console.log('444');
});
});
// Clear the database
// l2i.init(function(){l2i.on(function(){l2i.clear();});});
// Download a file with logs saved in IndexedDB
$('#download').click(function(){
l2i.download();
});
});
</script>
</head>
<body>
<h1>Logs2indexeddb test</h1>
<p>This test turns on l2i (logs2indexeddb) utility and write a few messages like<br>
<code>one<br>
two<br>
three</code><br> using <code>console.log()</code> method. <br>
You can check that there are messages in common console window and also in IndexedDB database named <code>logs2indexeddb</code> (open Resources tab in Javascript Console window and check that in IndexedDB -> logs2indexeddb -> logs->).</p>
<br>
<br>
<a href="#" id="download">Download file with logs from database</a>
</body>
</html>