diff --git a/js/DomManipulator.js b/js/DomManipulator.js index 6a010b6a..c17ea96e 100644 --- a/js/DomManipulator.js +++ b/js/DomManipulator.js @@ -64,7 +64,10 @@ class EtherAddressLookup { /(^|\s|:|-)((?:0x)[0-9a-fA-F]{40})(\s|$)/gi, // ENS Address Regex - /([a-z0-9][a-z0-9-\.]+[a-z0-9](?:\.eth))(\s|$)/gi + /(^|\s|:|-)([a-z0-9][a-z0-9-.]+[a-z0-9](?:\.eth))(\s|$)/gi, + + // ENS With ZWCs + /(^|\s|:|-)([a-z0-9][a-z0-9-.]*(\u200B|\u200C|\u200D|\uFEFF|\u2028|\u2029|‌|‌)[a-z0-9]*(?:\.eth))(\s|$)/gi ]; // Register RegEx Matching Patterns @@ -73,7 +76,10 @@ class EtherAddressLookup { /((?:0x)[0-9a-fA-F]{40})/gi, // ENS Match Pattern - this.regExPatterns[1] + this.regExPatterns[1], + + // ENS With ZWCs + this.regExPatterns[2] ]; // Register Replace Patterns @@ -87,10 +93,14 @@ class EtherAddressLookup { '$3', // ENS Address Replace - '$1$2' + 'target="'+ this.target +'">$2$3', + + // ENS With ZWCs Replace + '$1$2$3' ]; } @@ -117,8 +127,8 @@ class EtherAddressLookup { // On failure give the user a warning. if(!this.ENSCompatiable){ - this.replacePatterns[1] = '$1$2'; + this.replacePatterns[1] = '$1$2$3'; } } diff --git a/manifest.json b/manifest.json index 43dc93e4..edf061d5 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.10.1", + "version": "1.11.0", "browser_action": { "default_icon": "images/icon.png", diff --git a/package.json b/package.json index b88aaadf..1e0e4a34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "etheraddresslookup", - "version": "1.10.1", + "version": "1.11.0", "description": "A web extension for blocking ethereum phishing websites.", "main": "blacklists/domains.json", "scripts": {