Extra address checks (#164)

This commit is contained in:
Jaco Greeff
2021-03-09 10:51:18 +01:00
committed by GitHub
parent 8e9becb165
commit e7c109829a
6 changed files with 99 additions and 89 deletions
+4 -4
View File
@@ -13,10 +13,10 @@
"repository": "github.com:polkadot-js/phishing",
"homepage": "https://github.com/polkadot-js/common/tree/master/packages/phishing#readme",
"dependencies": {
"@babel/runtime": "^7.13.9",
"@polkadot/util": "^6.0.4",
"@polkadot/util-crypto": "^6.0.4",
"@polkadot/x-fetch": "^6.0.4"
"@babel/runtime": "^7.13.10",
"@polkadot/util": "^6.0.5",
"@polkadot/util-crypto": "^6.0.5",
"@polkadot/x-fetch": "^6.0.5"
},
"devDependencies": {
"@types/js-yaml": "^4.0.0",
+9 -2
View File
@@ -54,7 +54,13 @@ function checkTag (url: string, tag: string, attr?: string): Promise<[string, st
// /<\/?p( id="trnsctin")?>/g
return match && match.length
? match.map((v) => v.replace(new RegExp(`</?${tag}${attr ? `( ${attr})?` : ''}>`, 'g'), '').trim())
? match.map((v) =>
v
.replace(new RegExp(`</?${tag}${attr ? `( ${attr})?` : ''}>`, 'g'), '')
.replace(/<br>/g, '')
.replace(/<\/br>/g, '')
.trim()
)
: null;
});
}
@@ -114,7 +120,8 @@ function checkAll (): Promise<[string, string[]][]> {
'https://kusama-wallet.com/wallet.php',
'https://polkadot-wallet.org/wallet.php'
].map((u) => checkAttr(u, 'id="copyTarget" value=')),
checkTag('https://polkadotairdrop.com/address/', 'cool')
checkTag('https://polkadotairdrop.com/address/', 'cool'),
checkTag('https://polkadot-online.live/nnn/polkadot-live.online/block/index.html', 'p', 'id="t12uEsctin"')
]);
}