-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from brandoningli/trublock
Trublock UI
- Loading branch information
Showing
8 changed files
with
177 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
|
||
"description": "Attempts to block advertisements using a master filter list.", | ||
"manifest_version": 2, | ||
"name": "truBlock", | ||
"version": "1.0", | ||
"icons": { | ||
"48": "icons/icon.png", | ||
"96": "icons/icon96.png" | ||
}, | ||
|
||
"background": { | ||
"scripts": ["trublock.js"] | ||
}, | ||
|
||
"permissions": [ | ||
"webRequest", | ||
"webRequestBlocking", | ||
"http://*/*", | ||
"https://*/*" | ||
], | ||
|
||
"browser_action": { | ||
"default_popup": "popup.html" | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<link rel="stylesheet" href="style.css"> | ||
<script src="popup.js"></script> | ||
</head> | ||
|
||
<body> | ||
<img src="icons/icon96.png" alt="TruBlock Icon"> | ||
<h2>truBlock</h2> | ||
<div id="status">Active</div> | ||
<div class="button" id="toggle">Disable</div> | ||
<div id="attr"> | ||
|
||
<div id="team_name"> | ||
Written by Team <code>'; DROP TABLE team_names;</code> | ||
</div> | ||
|
||
<div id="indl_names"> | ||
Brandon Ingli, Chase Anderson, Andrew Flynn, Trey Reinheimer | ||
</div> | ||
|
||
<div id="institution"> | ||
Truman State University, CS 455, Computer Security Fundamentals | ||
</div> | ||
|
||
</div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
window.onload = function() { | ||
function updateLabel(page) { | ||
var enabled = page.getEnabled(); | ||
document.getElementById('toggle').innerHTML = enabled ? "Disable" : "Enable"; | ||
document.getElementById('status').innerHTML = enabled ? "Active" : "Stopped"; | ||
document.getElementById('status').className = enabled ? "running" : "stopped"; | ||
} | ||
|
||
function toggleEnabled(page) { | ||
page.toggleEnabled(); | ||
updateLabel(page); | ||
} | ||
|
||
function onError(error) { | ||
console.log(`Error: ${error}`); | ||
} | ||
document.getElementById('toggle').onclick = function() { | ||
var background = browser.runtime.getBackgroundPage(); | ||
background.then(toggleEnabled, onError); | ||
}; | ||
var background = browser.runtime.getBackgroundPage(); | ||
background.then(updateLabel, onError); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* Truman Official Color Palette (and Friends): | ||
Purple: #510b76; | ||
Dark Purple: #430b61; | ||
Darker Purple: #36084f; | ||
White: #ffffff; | ||
Gold: #8e774d; | ||
Light Gold: #bda06c; | ||
*/ | ||
|
||
@import url('https://fonts.googleapis.com/css?family=Abel|Inconsolata|Playfair+Display&display=swap'); | ||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
@keyframes fade { | ||
from { | ||
opacity: 0; | ||
} | ||
to { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
html { | ||
padding-bottom: 30px; | ||
} | ||
|
||
body { | ||
font-family: Abel, sans-serif; | ||
font-size: 14pt; | ||
margin: 15px; | ||
background: #510b76; | ||
background: linear-gradient(to right, #36084f, #510b76, #36084f); | ||
background-size: cover; | ||
color: white; | ||
word-wrap: break-word; | ||
text-align: center; | ||
} | ||
|
||
h1, | ||
h2, | ||
h3, | ||
h4, | ||
h5, | ||
h6 { | ||
font-family: "Playfair Display", serif; | ||
margin-bottom: 8px; | ||
margin-top: 8px; | ||
} | ||
|
||
.stopped { | ||
color: red; | ||
} | ||
|
||
.running { | ||
color: greenyellow; | ||
} | ||
|
||
.button { | ||
display: inline-block; | ||
text-decoration: none; | ||
border: 2px solid #bda06c; | ||
padding: 5px; | ||
margin-bottom: 15px; | ||
background: #8e774d; | ||
color: white; | ||
text-align: center; | ||
font-weight: normal; | ||
transition: background-color 0.5s, text-decoration 0.5s; | ||
} | ||
|
||
.button:hover { | ||
text-decoration: underline; | ||
background-color: #bda06c; | ||
} | ||
|
||
#attr { | ||
font-size: medium; | ||
} | ||
|
||
#status { | ||
margin-bottom: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var enabled = true; | ||
|
||
function getEnabled() { | ||
return enabled; | ||
} | ||
|
||
function toggleEnabled() { | ||
enabled = !enabled; | ||
} | ||
|
||
/* BLOCKING CODE GOES HERE */ |