-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.js
More file actions
24 lines (24 loc) · 918 Bytes
/
Copy pathsearch.js
File metadata and controls
24 lines (24 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var param = null
if(new URL(location).searchParams.get("dname") !== null){
param = new URL(location).searchParams.get("dname")
}
console.log(param)
var main = async function(){
var datareq = await fetch("https://raw.githubusercontent.com/iam-py-test/unwanted-program-removal-tool/main/data_1.json")
var data = JSON.parse(await datareq.text())
console.log(data)
document.getElementById('search').textContent = param
threatname = param
try{
console.log(data[threatname])
document.title = threatname
document.getElementById("desc").innerText = (data[threatname].desc||"Not found")
document.getElementById("company").textContent = (data[threatname]["company_responsible"]||"N/A")
document.getElementById("level1").textContent = (data[threatname]["threat_level"]||"Unknown")
}
catch(err){
console.log(err)
document.getElementById("desc").textContent = "Not found"
}
}
main()