Skip to content

Commit 8fb9203

Browse files
first commit
1 parent c09d705 commit 8fb9203

File tree

7 files changed

+189
-2
lines changed

7 files changed

+189
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# Emergency-Blood-Plasma-Notification-System
2-
Emergency Blood/Plasma Notification System
1+
# Emergency Notification System

images/unnamed1.png

7.25 KB
Loading

life.jpg

50.6 KB
Loading

manifest.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{ "manifest_version": 2,
2+
"background": {
3+
"scripts": ["popup.js"],
4+
"persistent": true
5+
},
6+
7+
"name":"Serum Ledger",
8+
"description":"Emergency notification system",
9+
"version":"1.0.0",
10+
"icons":{"128":"unnamed1.png"},
11+
"browser_action": {
12+
"default_icon": "unnamed1.png",
13+
"default_popup": "popup.html"
14+
},
15+
"permissions":["https://detecturl.herokuapp.com/","storage","tabs","activeTab","<all_urls>","webRequest","webRequestBlocking","https://*/","notifications" ]
16+
}

popup.html

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
7+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8+
<title>Serum Ledger</title>
9+
<style>
10+
.button {
11+
background-color:rgba(0, 162, 255, 0.836);
12+
/* Green */
13+
border: none;
14+
color: white;
15+
padding: 10px 15px;
16+
text-align: center;
17+
text-decoration: none;
18+
display: inline-block;
19+
font-size: 14px;
20+
21+
}
22+
</style>
23+
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
24+
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"/>
25+
<script src="https://gitcdn.github.io/bootstrap-toggle/2.2.2/js/bootstrap-toggle.min.js"></script>
26+
<!-- Font Awesome -->
27+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.2/css/all.css">
28+
<!-- Google Fonts -->
29+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap">
30+
<!-- Bootstrap core CSS -->
31+
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/css/bootstrap.min.css" rel="stylesheet">
32+
<!-- Material Design Bootstrap -->
33+
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.13.0/css/mdb.min.css" rel="stylesheet">
34+
</head>
35+
36+
<body style="box-shadow: 0 4px 8px 0 white;">
37+
<div class="modal-header" style="background:whitesmoke;width: 20rem;text-align: center;">
38+
<h1 class="logo" text-align="center">
39+
<align="center"><img src="images/unnamed1.png" alt="Malicious URL Detector" class="logo-icon"
40+
style="margin: 0 auto;display:block;margin-left: 4.5rem;">
41+
<p style="font-size: 26px;color:black;margin: 0 auto;text-align: center;display: block;margin-left: 4rem;">Serum Ledger</p>
42+
</align="center">
43+
</h1>
44+
</div>
45+
<!-- Default switch -->
46+
47+
48+
<div class="col-md-6">
49+
<div class="row">
50+
<form class="text-center border border-light p-5" autocomplete="off" action="https://mudvfinalradar.eu-gb.cf.appdomain.cloud/result" id="myForm" target="_blank" style="margin: auto;
51+
margin-top: 8px;margin-bottom:8px" >
52+
<input type="text" class="form-control mb-4" name="url" placeholder="Enter Tracking Location" style="border: groove;" required>
53+
<button class="btn btn-info btn-block my-4" type="submit">Get Status</button>
54+
</form>
55+
</div>
56+
</div>
57+
58+
59+
<div class="card">
60+
<div class="card-body" slot="background:black;" style="font: status-bar;">
61+
<!-- Title -->
62+
<a href="https://mudvfinalradar.eu-gb.cf.appdomain.cloud/" class="button" target="_blank;"
63+
style="text-align: center;display: block;margin:0 auto;font-size: 1rem">Check Out Web Application</a>
64+
<!-- Text -->
65+
<!-- Button -->
66+
</div>
67+
</div>
68+
69+
<scripts src="popup.js"></scripts>
70+
71+
<!-- JQuery -->
72+
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
73+
<!-- Bootstrap tooltips -->
74+
<script type="text/javascript"
75+
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
76+
<!-- Bootstrap core JavaScript -->
77+
<script type="text/javascript"
78+
src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
79+
<!-- MDB core JavaScript -->
80+
<script type="text/javascript"
81+
src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.13.0/js/mdb.min.js"></script>
82+
<script>
83+
84+
</script>
85+
</body>
86+
87+
</html>

popup.js

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
2+
3+
chrome.tabs.query({'active': true, 'lastFocusedWindow': true, 'currentWindow': true}, function (tabs) {
4+
var url = tabs[0].url;
5+
theUrl="https://node-blood-donation-app.herokuapp.com/getdonors/api?location=delhi";//+url;
6+
//theUrl2="https://mudvfinalradar.eu-gb.cf.appdomain.cloud/result?url="+url;
7+
//console.log(url);
8+
//alert ("Hello")
9+
10+
if (url!="chrome://newtab/")
11+
{
12+
//fetch(theUrl2)
13+
14+
//console.log("Script Started");
15+
var obj;
16+
17+
fetch(theUrl)
18+
.then((response) => {
19+
//alert (response.json().allusers.length)
20+
return response.json();
21+
22+
})
23+
24+
.then((myJson) => {
25+
obj = myJson;
26+
27+
//alert(obj.allusers.length)
28+
if (obj.allusers.length >= 1)
29+
{
30+
function show() {
31+
32+
new Notification("Donor found nearby !!", {
33+
icon: 'life.jpg',
34+
body: 'Donor found nearby\nClick to see detailed tracking information'
35+
}).onclick = (e) => {
36+
window.open("https://node-blood-donation-app.herokuapp.com/track");
37+
}
38+
39+
40+
};
41+
42+
43+
44+
// Conditionally initialize the options.
45+
if (!localStorage.isInitialized) {
46+
localStorage.isActivated = true; // The display activation.
47+
localStorage.frequency = 10; // The display frequency, in minutes.
48+
localStorage.isInitialized = true; // The option initialization.
49+
}
50+
51+
// Test for notification support.
52+
if (window.Notification) {
53+
// While activated, show notifications at the display frequency.
54+
if (JSON.parse(localStorage.isActivated)) { show(); }
55+
56+
57+
}
58+
59+
/*alert("Malicious URL Detected !! \n"+url);
60+
if (window.confirm("Do you want to leave this unsafe site? \n\nThis site is not safe!!")) {
61+
window.open("https://www.google.com/", "You have been re-directed to a safe site!!");
62+
}
63+
*/
64+
}
65+
66+
67+
});
68+
//console.log(obj);
69+
70+
71+
72+
}
73+
74+
75+
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
76+
chrome.runtime.reload();
77+
});
78+
});
79+
80+
81+
82+
83+
84+
85+

unnamed1.png

7.25 KB
Loading

0 commit comments

Comments
 (0)