Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
* release: (21 commits)
  Bumped version number
  Added clarification about the extension icon change
  Removed logic to change extension icon on 'whitelist' - this list is used to catch false-positives - it is not an endorsed whitelist
  Clarified which blacklist we are looking at
  Added logic to see if the preferred explorer and the RPC node is on different networks
  Removed console.logs - ensured segasec blacklist is unique
  Added logic to ensure unique values on EAL blacklist
  Added logic to dedupe blacklisted domains
  Fixes #1071
  Styling
  Added thanks to hive.one and a QR code for donations
  Changed CryptoInfluencers to HiveOne branding
  Updated version and changed default icon
  Styling
  Added logic to change the extension icon color
  Modified badges to have a black border
  Removed console.log()
  Added method to change the domain icon to indicate domain trust
  Modified styling
  Added note about icon change when on a bookmarked domain
  ...
  • Loading branch information
409H committed Feb 25, 2019
2 parents c7abf93 + c96b0cf commit 17b3731
Show file tree
Hide file tree
Showing 21 changed files with 319 additions and 51 deletions.
56 changes: 45 additions & 11 deletions css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/app.css.map

Large diffs are not rendered by default.

21 changes: 17 additions & 4 deletions css/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@
font-size: 10pt;
color: #c2c6c7;
line-height: 10pt;

&_network_diff {
display: none;
margin-top: 0.3em;
padding-top: 1em;
color: red;
font-size: 10pt;
}
}
}

Expand Down Expand Up @@ -541,7 +549,7 @@
overflow-y: hidden;
user-select: none;

.ext-etheraddresslookup-0xaddress.display-popup > & {
.ext-etheraddresslookup-0xaddress.ext-etheraddresslookup-display-popup > & {
display: inline-block;
}

Expand Down Expand Up @@ -581,19 +589,24 @@
color: #fff;
padding: 3px;
font-size: 8pt;
clear: both;
}

#{&}_node_ok {
all: initial;
user-select: none;
background: #32a735;
border-radius: 50%;
border-radius: 5em;
height: 10px;
width: 10px;
width: auto;
position: absolute;
right: 5%;
display: none;
z-index: 1;
z-index: 2;
color: #fff;
padding: 3px;
font-size: 8pt;
clear: both;
}
}

Expand Down
14 changes: 9 additions & 5 deletions css/settings.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/settings.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion css/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ body {
.pure-g {
margin-bottom: 5%;

.pure-u-1-3, .pure-u-2-3, .pure-u-1-1 {
.setting-container {
background: $u_background;
color: $u_color;
border: 2px solid darken($main_background, 5%);
Expand Down Expand Up @@ -113,4 +113,10 @@ body {
color: $success_color;
border: 2px solid darken($success_background, 1%);
text-align: center;
}

#ext-icon-whitelisted {
display: inline-block;
height: 25px;
width: 25px;
}
Binary file removed images/cryptoinfluencers.png
Binary file not shown.
Binary file added images/ether-128x128-black_badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ether-128x128-green_badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ether-128x128-red_badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/hiveone.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion js/DomManipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let objBrowser = chrome ? chrome : browser;

const EXT_PREFIX = 'ext-etheraddresslookup';
const HOVER_POPUP_CLASS_NAME = `${EXT_PREFIX}-address_stats_hover`;
const ADDRESS_DISPLAY_POPUP_CLASS_NAME = 'display-popup';
const ADDRESS_DISPLAY_POPUP_CLASS_NAME = `${EXT_PREFIX}-display-popup`;
const ATTRIBUTE_ADDRESS_UNIQUE_ID = `data-${EXT_PREFIX}-address-unique-id`;
const LABEL_LOADED_ATTRIBUTE = `data-${EXT_PREFIX}-label-loaded`;

Expand Down Expand Up @@ -389,6 +389,11 @@ class EtherAddressLookup {
}

if (!addressElement.classList.contains(ADDRESS_DISPLAY_POPUP_CLASS_NAME)) {

if(document.querySelector(`.${ADDRESS_DISPLAY_POPUP_CLASS_NAME}`)) {
document.querySelector(`.${ADDRESS_DISPLAY_POPUP_CLASS_NAME}`).classList.remove(ADDRESS_DISPLAY_POPUP_CLASS_NAME)
}

addressElement.classList.add(ADDRESS_DISPLAY_POPUP_CLASS_NAME);
}

Expand All @@ -407,6 +412,7 @@ class EtherAddressLookup {
</p>
<div id='${EXT_PREFIX}-address_stats_hover_node_error_${uniqueAddressId}' class='${EXT_PREFIX}-address_stats_hover_node_error'></div>
<div id='${EXT_PREFIX}-address_stats_hover_node_ok_${uniqueAddressId}' class='${EXT_PREFIX}-address_stats_hover_node_ok'></div>
<br />
<span id='${EXT_PREFIX}-address_balance_${uniqueAddressId}'></span>
<span id='${EXT_PREFIX}-transactions_out_${uniqueAddressId}'></span>
<span id='${EXT_PREFIX}-contract_address_${uniqueAddressId}'></span>
Expand Down Expand Up @@ -435,6 +441,7 @@ class EtherAddressLookup {
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_error_"+uniqueAddressId).innerText = "There were RPC errors";
} else {
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_ok_"+uniqueAddressId).style.display = "inline";
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_ok_"+uniqueAddressId).innerText = "RPC calls successful";
intTransactionCount = parseInt(result).toLocaleString();
}

Expand All @@ -455,6 +462,7 @@ class EtherAddressLookup {
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_error_"+uniqueAddressId).innerText = "There were RPC errors";
} else {
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_ok_"+uniqueAddressId).style.display = "inline";
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_ok_"+uniqueAddressId).innerText = "RPC calls successful";
flEthBalance = web3.fromWei(result.toString(10), "ether").toLocaleString("en-US", {maximumSignificantDigits: 9});
}

Expand All @@ -476,6 +484,7 @@ class EtherAddressLookup {
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_error_"+uniqueAddressId).innerText = "There were RPC errors";
} else {
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_ok_"+uniqueAddressId).style.display = "inline";
objHoverNodeContent.querySelector("#ext-etheraddresslookup-address_stats_hover_node_ok_"+uniqueAddressId).innerText = "RPC calls successful";
var blIsContractAddress = result == "0x" ? false : true;
if (blIsContractAddress) {
objContractAddress.innerHTML += "<small>This is a contract address</small>";
Expand Down
37 changes: 37 additions & 0 deletions js/DomainBlacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@

function doBlacklistCheck(arrWhitelistedDomains, arrBlacklistedDomains)
{

// Check the user bookmarks to see if they trust the domain
objBrowser.runtime.sendMessage({func: "user_domain_bookmarks"}, function(objResponse) {
if(objResponse && objResponse.hasOwnProperty("resp")) {
var strCurrentTab = window.location.hostname.replace(/www\./g,'');
var objBookmarks = JSON.parse(objResponse.resp);

for(var intKey in objBookmarks) {
if(objBookmarks.hasOwnProperty(intKey)) {
var strBookmarkUrl = objBookmarks[intKey]["url"].replace(/https?\:\/\//, '').toLowerCase();
strBookmarkUrl = strBookmarkUrl.split("/")[0];
if(strBookmarkUrl === strCurrentTab.toLowerCase()) {
objBrowser.runtime.sendMessage({func: "change_ext_icon", "icon": "whitelisted", "type": "bookmarked"}, function(objResponse) {
// Icon should be a different colour now.
});
return false;
}
}
}
}
});

//See if we are blocking all punycode domains.
objBrowser.runtime.sendMessage({func: "block_punycode_domains"}, function(objResponse) {
if(objResponse && objResponse.hasOwnProperty("resp")) {
Expand All @@ -37,6 +59,11 @@
arrDomainParts.forEach(strDomainPart => {
if (strDomainPart.startsWith("xn--")) {
window.location.href = chrome.runtime.getURL('/static/phishing/phishing.html#') + (window.location.hostname) + "#punycode";

objBrowser.runtime.sendMessage({func: "change_ext_icon", "icon": "blacklisted", "type": "punycode"}, function(objResponse) {
// Icon should be a different colour now.
});

return false;
}
});
Expand Down Expand Up @@ -74,6 +101,11 @@
if (arrWhitelistedDomains.indexOf(strCurrentTab) < 0 && (isBlacklisted === true || blHolisticStatus === true)) {
console.warn(window.location.href + " is blacklisted by EAL - "+ (isBlacklisted ? "Blacklisted" : "Levenshtein Logic"));
window.location.href = chrome.runtime.getURL('/static/phishing/phishing.html#') + (window.location.hostname) +"#"+ (isBlacklisted ? "blacklisted" : "levenshtein");

objBrowser.runtime.sendMessage({func: "change_ext_icon", "icon": "blacklisted", "type": (isBlacklisted ? "blacklisted": "levenshtein")}, function(objResponse) {
// Icon should be a different colour now.
});

return false;
}
}
Expand Down Expand Up @@ -106,6 +138,11 @@
window.location.href = chrome.runtime.getURL('/static/phishing/phishing.html#') + (window.location.hostname) +"#blacklisted";
break;
}

objBrowser.runtime.sendMessage({func: "change_ext_icon", "icon": "blacklisted", "type": "thirdparty"}, function(objResponse) {
// Icon should be a different colour now.
});

return false;
}
}
Expand Down
Loading

0 comments on commit 17b3731

Please sign in to comment.