From 7f8f18f908fab5242604ab79a224ad2e48d09482 Mon Sep 17 00:00:00 2001 From: Jaco Date: Sat, 14 May 2022 14:19:58 +0200 Subject: [PATCH] Filter for extensions (#7579) --- packages/react-api/src/Api.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/react-api/src/Api.tsx b/packages/react-api/src/Api.tsx index acba5b4117..0394685142 100644 --- a/packages/react-api/src/Api.tsx +++ b/packages/react-api/src/Api.tsx @@ -57,6 +57,15 @@ export const DEFAULT_DECIMALS = registry.createType('u32', 12); export const DEFAULT_SS58 = registry.createType('u32', addressDefaults.prefix); export const DEFAULT_AUX = ['Aux1', 'Aux2', 'Aux3', 'Aux4', 'Aux5', 'Aux6', 'Aux7', 'Aux8', 'Aux9']; +const DISALLOW_EXTENSIONS = [ + // The issue here is that they build on the polkadot-js extension, which is all good and + // certainly encouraged. Copying the code, all good, it is meant to be used and broken in + // weird and wonderful ways. Then the team changed all the copyright headers to drop + // attribution to the original project. This is not good. + // See https://github.com/Koniverse/SubWallet-Extension/commit/ad4c510779e0e26c0e12159f9ee99c1763c6a0e6 + 'subwallet-js' +]; + let api: ApiPromise; export { api }; @@ -118,7 +127,9 @@ async function retrieve (api: ApiPromise, injectedPromise: Promise + !DISALLOW_EXTENSIONS.includes(source) + ), properties: registry.createType('ChainProperties', { ss58Format: api.registry.chainSS58, tokenDecimals: api.registry.chainDecimals,