-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconsole_stamp_bug.js
46 lines (44 loc) · 1.59 KB
/
console_stamp_bug.js
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
javascript:
(
async ()=>
{
the_type = "bug";
the_title = document.title;
the_place = window.location.href;
the_text = window.getSelection().toString();
the_time = Date().valueOf();
the_message = prompt("What seems wrong?");
if (the_message != null)
{
json_version = {"time": the_time, "test notes":{"message": the_message, "title": the_title, "place": the_place, "text": the_text, "type": the_type}};
const dbName = 'SatisficeCoverageRecorder';
await window.indexedDB.databases().then(
(dbs) => {
out = dbs.map((db)=>{return db.name == dbName;});
if (out.includes(true))
{
if (window.localStorage.getItem("SatisficeCoverageReporter_active") == "started")
{
let db;
const request = window.indexedDB.open(dbName);
request.onsuccess = (event) => {
db = event.target.result;
const transaction = db.transaction(["Events"], "readwrite");
const objectStore = transaction.objectStore("Events");
const request = objectStore.add(json_version);
}
}
}
}
);
console.log(JSON.stringify(json_version) + "\n"
+ "*** Test Stamp ***"
+ "\n TIME: " + the_time
+ "\n MESSAGE: " + the_message
+ "\n TITLE: " + the_title
+ "\n URL: " + the_place
+ "\nSELECTED TEXT: " + the_text
+ "\n" );
}
}
)();