Skip to content

Commit

Permalink
Fixed merge conflict - updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
409H committed Nov 10, 2017
2 parents 26906d9 + 0a0634f commit bd23a62
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
24 changes: 17 additions & 7 deletions js/DomManipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -87,10 +93,14 @@ class EtherAddressLookup {
'</a>$3',

// ENS Address Replace
'<a title="See this address on the blockchain explorer" ' +
'href="' + this.strBlockchainExplorer + '/$1" ' +
'$1<a title="See this address on the blockchain explorer" ' +
'href="' + this.strBlockchainExplorer + '/$2" ' +
'class="ext-etheraddresslookup-link" ' +
'target="'+ this.target +'">$1</a>$2'
'target="'+ this.target +'">$2</a>$3',

// ENS With ZWCs Replace
'$1<slot title="WARNING! This ENS address has ZWCs. Someone may be trying to scam you." ' +
'class="ext-etheraddresslookup-warning">$2</slot>$3'
];
}

Expand All @@ -117,8 +127,8 @@ class EtherAddressLookup {

// On failure give the user a warning.
if(!this.ENSCompatiable){
this.replacePatterns[1] = '<a title="Notification! We have spotted an ENS address, your current block explorer can\'t parse this address. Please choose a compatible block explorer." ' +
'class="ext-etheraddresslookup-link ext-etheraddresslookup-warning" href="#">$1</a>$2';
this.replacePatterns[1] = '$1<a title="Notification! We have spotted an ENS address, your current block explorer can\'t parse this address. Please choose a compatible block explorer." ' +
'class="ext-etheraddresslookup-link ext-etheraddresslookup-warning" href="#">$2</a>$3';
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit bd23a62

Please sign in to comment.