diff --git a/css/app.css b/css/app.css index ff37cd3a..b3c885f4 100644 --- a/css/app.css +++ b/css/app.css @@ -148,13 +148,16 @@ .ext-etheraddresslookup-address_stats_hover_node_error { all: initial; background: #d02626; - border-radius: 50%; + border-radius: 5em; height: 10px; - width: 10px; + width: auto; position: absolute; right: 5%; display: none; z-index: 2; + color: #fff; + padding: 3px; + font-size: 8pt; } .ext-etheraddresslookup-address_stats_hover_node_ok { all: initial; diff --git a/js/DomManipulator.js b/js/DomManipulator.js index 8ae1eaa0..b13310b5 100644 --- a/js/DomManipulator.js +++ b/js/DomManipulator.js @@ -161,7 +161,7 @@ class EtherAddressLookup { */ convertAddressToLink() { - var arrWhitelistedTags = ["code", "span", "p", "td", "li", "em", "i", "b", "strong", "small"]; + var arrWhitelistedTags = ["div", "code", "span", "p", "td", "li", "em", "i", "b", "strong", "small"]; //Get the whitelisted nodes for(var i=0; i"; + objHoverNodeContent.innerHTML += ""; } return false; diff --git a/js/app/chooseBlockchain.js b/js/app/chooseBlockchain.js index e695badb..6c3dcc95 100644 --- a/js/app/chooseBlockchain.js +++ b/js/app/chooseBlockchain.js @@ -21,11 +21,16 @@ function refreshBlockchainExplorer() { //Notify the tab to do a class method var strMethod = "changeBlockchainExplorer"; - chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { - chrome.tabs.sendMessage(tabs[0].id, { + var objBrowser = chrome ? chrome : browser; + objBrowser.tabs.query({active: true, currentWindow: true}, function(tabs) { + objBrowser.tabs.sendMessage(tabs[0].id, { "func":strMethod - }, function(response) { - console.log(response); + }, function(objResponse) { + if(objResponse.status) { + console.log("Response from tab: " + objResponse.status); + } else { + console.log("Cannot "+ strMethod +" on tab."); + } }); }); } \ No newline at end of file diff --git a/js/app/historyInspector.js b/js/app/historyInspector.js index dda11e95..26854c11 100644 --- a/js/app/historyInspector.js +++ b/js/app/historyInspector.js @@ -1,33 +1,34 @@ (function () { var objHistoryInspector = document.getElementById("ext-etheraddresslookup-history_inspect"); - //Perform the history inspection - objHistoryInspector.addEventListener("click", function (objEvent) { - //See if we need to request permission - chrome.permissions.contains({ - permissions: ['history'] - }, function (blResult) { - //No permission to history, ask for it. - if (blResult === false) { - chrome.permissions.request({ - permissions: ['history'] - }, function (blGranted) { - if (blGranted) { - console.log("Granted history permission"); - doHistoryInspection(); - } else { - exitNoPermission(); - } - }); - } else { - doHistoryInspection(); - } + if(typeof chrome !== 'undefined') { + objHistoryInspector.addEventListener('click', event => { + chrome.permissions.request({permissions: ['history']}, function(blGranted) { + if (blGranted) { + console.log("Granted history permission"); + doHistoryInspection(); + } else { + exitNoPermission(); + } + }); }); - }); + } else { + objHistoryInspector.addEventListener('click', event => { + browser.permissions.request({permissions: ['history']}).then((blGranted) => { + if (blGranted) { + console.log("Granted history permission"); + doHistoryInspection(); + } else { + exitNoPermission(); + } + }); + }); + } })(); function doHistoryInspection() { - chrome.history.search({text: "", maxResults: 500}, function (objHistoryItems) { + var objBrowser = chrome ? chrome : browser; + objBrowser.history.search({text: "", maxResults: 500}, function (objHistoryItems) { var blRedirected = false; var intTotalWarnings = 0; var strReportText = ""; @@ -88,7 +89,8 @@ function exitNoPermission() function removePermission() { - chrome.permissions.remove({ + var objBrowser = chrome ? chrome : browser; + objBrowser.permissions.remove({ permissions: ['history'] }, function(removed) { if (removed) { diff --git a/js/app/toggleBlacklistDomains.js b/js/app/toggleBlacklistDomains.js index 67e79e94..26c54b5d 100644 --- a/js/app/toggleBlacklistDomains.js +++ b/js/app/toggleBlacklistDomains.js @@ -29,8 +29,9 @@ function toggle3rdPartyBlacklistDomains() function refreshBlacklistDomains() { - chrome.runtime.sendMessage({func: "blacklist_domain_list"}, function(objResponse) { - console.log("BDL-001"); + var objBrowser = chrome ? chrome : browser; + objBrowser.runtime.sendMessage({func: "blacklist_domain_list"}, function(objResponse) { + console.log("BDL-001 - Fetched blacklisted domains"); }); var intBlacklistDomains = localStorage.getItem("ext-etheraddresslookup-blacklist_domains"); diff --git a/js/app/toggleBookmarks.js b/js/app/toggleBookmarks.js index bb29799a..2c3fffa9 100644 --- a/js/app/toggleBookmarks.js +++ b/js/app/toggleBookmarks.js @@ -48,8 +48,8 @@ function getBookmarks() if(strBookmarks === null) { var arrBookmarks = new Array(); arrBookmarks.push({ - "icon": "images/bookmarks/myetherwallet.png", - "url": "https://myetherwallet.com" + "icon": "https://www.google.com/s2/favicons?domain=https://mycrypto.com", + "url": "https://mycrypto.com" }); arrBookmarks.push({ "icon": "images/bookmarks/etherscan.png", diff --git a/js/app/toggleMatchHighlight.js b/js/app/toggleMatchHighlight.js index 64a4c77c..03cac88b 100644 --- a/js/app/toggleMatchHighlight.js +++ b/js/app/toggleMatchHighlight.js @@ -4,7 +4,8 @@ })(); //Sets the local storage to remember their match highlight settings -function toggleMatchHighlight() { +function toggleMatchHighlight() +{ var objShowHighlight = document.getElementById("ext-etheraddresslookup-show_style"); var intShowHighlight = objShowHighlight.checked ? 1 : 0; localStorage.setItem("ext-etheraddresslookup-show_style", intShowHighlight); @@ -12,16 +13,22 @@ function toggleMatchHighlight() { refreshHighlightOption(); } -function refreshHighlightOption() { +function refreshHighlightOption() +{ + var objBrowser = chrome ? chrome : browser; var intShowHighlight = localStorage.getItem("ext-etheraddresslookup-show_style"); document.getElementById("ext-etheraddresslookup-show_style").checked = (intShowHighlight == 1 ? true : false); //Notify the tab to do a class method var strMethod = (intShowHighlight == 1 ? "addHighlightStyle" : "removeHighlightStyle"); - chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { - chrome.tabs.sendMessage(tabs[0].id, { + objBrowser.tabs.query({active: true, currentWindow: true}, function(tabs) { + objBrowser.tabs.sendMessage(tabs[0].id, { "func":strMethod - }, function(response) { - console.log(response); + }, function(objResponse) { + if(objResponse.status) { + console.log("Response from tab: " + objResponse.status); + } else { + console.log("Cannot "+ strMethod +" on tab."); + } }); }); } \ No newline at end of file diff --git a/js/options.js b/js/options.js index 2905cdb4..33a1093d 100644 --- a/js/options.js +++ b/js/options.js @@ -143,7 +143,7 @@ function getBlacklistedDomains(strType) "timestamp": 0, "domains": [], "format": "plain", - "repo": "https://raw.githubusercontent.com/409H/EtherAddressLookup/master/blacklists/domains.json", + "repo": "http://api.infura.io/v1/blacklist", "identifer": "eal" }, "third_party": { diff --git a/manifest.json b/manifest.json index 8b35c9b0..3fe3aee9 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "EtherAddressLookup", "short_name": "EtherAddressLookup", "description": "Adds links to strings that look like Ethereum addresses to your favorite blockchain explorer.", - "version": "1.14.3", + "version": "1.15.1", "browser_action": { "default_icon": "images/icon.png", diff --git a/package.json b/package.json index 1e0e4a34..e94035fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "etheraddresslookup", - "version": "1.11.0", + "version": "1.15.1", "description": "A web extension for blocking ethereum phishing websites.", "main": "blacklists/domains.json", "scripts": {