-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ft-cached_blacklist: Additions to the description Added icon images Added icon images Added listener to fetch blacklisted domains and logic to check the cache before going to github Increased version number Added text to show blacklisted domain stats Added logic to show you how many domains are blacklisted and when your last cache was Added logic to fetch the blacklisted domains that are cached and cleared the dom before I append to it Added styling for blacklist stats
- Loading branch information
Showing
11 changed files
with
133 additions
and
46 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,28 +1,35 @@ | ||
.ext-etheraddresslookup-link-highlight { | ||
padding: 2px; | ||
background: #F2EAAC; | ||
color: #000; | ||
border: 1px solid #C7BC67; | ||
} | ||
|
||
.ext-etheraddresslookup-link-no_highlight { | ||
padding: 0px; | ||
background: transparent; | ||
border: 1px solid transparent; | ||
color: inherit; | ||
} | ||
|
||
#ext-etheraddresslookup-popup { | ||
margin: 0; | ||
padding: 0px; | ||
font-family: "Arial"; | ||
font-size: 12pt; | ||
width: 300px; | ||
} | ||
#ext-etheraddresslookup-popup #content { | ||
padding: 15px; | ||
margin-top: 15px; | ||
} | ||
#ext-etheraddresslookup-popup #content #footer { | ||
font-size: 70%; | ||
} | ||
.ext-etheraddresslookup-link-highlight { | ||
padding: 2px; | ||
background: #F2EAAC; | ||
color: #000; | ||
border: 1px solid #C7BC67; | ||
} | ||
|
||
.ext-etheraddresslookup-link-no_highlight { | ||
padding: 0px; | ||
background: transparent; | ||
border: 1px solid transparent; | ||
color: inherit; | ||
} | ||
|
||
#ext-etheraddresslookup-popup { | ||
margin: 0; | ||
padding: 0px; | ||
font-family: "Arial"; | ||
font-size: 12pt; | ||
width: 300px; | ||
} | ||
#ext-etheraddresslookup-popup #content { | ||
padding: 15px; | ||
margin-top: 15px; | ||
} | ||
#ext-etheraddresslookup-popup #content #footer { | ||
font-size: 70%; | ||
} | ||
|
||
#ext-etheraddresslookup-blacklist_domains_stats { | ||
font-size: 10pt; | ||
color: #c2c6c7; | ||
line-height: 10pt; | ||
padding-left: 3.5em; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -1,18 +1,49 @@ | ||
//On page load it checks/unchecks the checkbox | ||
(function() { | ||
(function() | ||
{ | ||
refreshBlacklistDomains(); | ||
|
||
getBlacklistStats(); | ||
setInterval(function() {getBlacklistStats()}, 3000); | ||
})(); | ||
|
||
//Sets the local storage to remember their match blacklist settings | ||
function toggleBlacklistDomains() { | ||
function toggleBlacklistDomains() | ||
{ | ||
var objBlacklistDomains = document.getElementById("ext-etheraddresslookup-blacklist_domains"); | ||
var intBlacklistDomains = objBlacklistDomains.checked ? 1 : 0; | ||
localStorage.setItem("ext-etheraddresslookup-blacklist_domains", intBlacklistDomains); | ||
|
||
refreshBlacklistDomains(); | ||
} | ||
|
||
function refreshBlacklistDomains() { | ||
function refreshBlacklistDomains() | ||
{ | ||
chrome.runtime.sendMessage({func: "blacklist_domain_list"}, function(objResponse) { | ||
console.log("BDL-001"); | ||
}); | ||
|
||
var intBlacklistDomains = localStorage.getItem("ext-etheraddresslookup-blacklist_domains"); | ||
document.getElementById("ext-etheraddresslookup-blacklist_domains").checked = (intBlacklistDomains == 1 ? true : false); | ||
} | ||
|
||
function getBlacklistStats() | ||
{ | ||
var objLastUpdatedText = document.getElementById("ext-etheraddresslookup-blacklist_domains_last_updated"); | ||
var objTotalCountText = document.getElementById("ext-etheraddresslookup-blacklist_domains_total_count"); | ||
var objBlacklistedDomains = localStorage.getItem("ext-etheraddresslookup-blacklist_domains_list"); | ||
objBlacklistedDomains = JSON.parse(objBlacklistedDomains); | ||
var intLastUpdated = objBlacklistedDomains.timestamp; | ||
|
||
objLastUpdatedText.innerText = timeDifference(Math.floor(Date.now()/1000), intLastUpdated); | ||
objTotalCountText.innerText = new Intl.NumberFormat().format(objBlacklistedDomains.domains.length); | ||
} | ||
|
||
function timeDifference(current, previous) | ||
{ | ||
var elapsed = parseInt(current) - parseInt(previous); | ||
if(elapsed > 59) { | ||
return Math.floor(elapsed / 60) + ' minutes ago'; | ||
} | ||
return Math.round(elapsed) + ' seconds ago'; | ||
} |
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
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
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