|
|
|
@ -52,11 +52,6 @@ let requiredModules = [ // services + layout views + system views |
|
|
|
|
'ganache-provider', |
|
|
|
|
'foundry-provider', |
|
|
|
|
'basic-http-provider', |
|
|
|
|
'injected-trustwallet', |
|
|
|
|
'injected-optimism-provider', |
|
|
|
|
'injected-arbitrum-one-provider', |
|
|
|
|
'injected-ephemery-testnet-provider', |
|
|
|
|
'injected-skale-chaos-testnet-provider', |
|
|
|
|
'vm-custom-fork', |
|
|
|
|
'vm-goerli-fork', |
|
|
|
|
'vm-mainnet-fork', |
|
|
|
@ -97,7 +92,12 @@ const sensitiveCalls = { |
|
|
|
|
web3Provider: ['sendAsync'] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const isInjectedProvicer = (name) => { |
|
|
|
|
return name.startsWith('injected') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export function isNative(name) { |
|
|
|
|
|
|
|
|
|
// nativePlugin allows to bypass the permission request
|
|
|
|
|
const nativePlugins = [ |
|
|
|
|
'vyper', |
|
|
|
@ -116,19 +116,16 @@ export function isNative(name) { |
|
|
|
|
'ganache-provider', |
|
|
|
|
'foundry-provider', |
|
|
|
|
'basic-http-provider', |
|
|
|
|
'injected-optimism-provider', |
|
|
|
|
'tabs', |
|
|
|
|
'injected-arbitrum-one-provider', |
|
|
|
|
'injected-skale-chaos-testnet-provider', |
|
|
|
|
'injected-ephemery-testnet-provider', |
|
|
|
|
'doc-gen', |
|
|
|
|
'doc-viewer', |
|
|
|
|
'circuit-compiler', |
|
|
|
|
'compilationDetails', |
|
|
|
|
'vyperCompilationDetails', |
|
|
|
|
'remixGuide', |
|
|
|
|
'walletconnect' |
|
|
|
|
] |
|
|
|
|
return nativePlugins.includes(name) || requiredModules.includes(name) |
|
|
|
|
return nativePlugins.includes(name) || requiredModules.includes(name) || isInjectedProvicer(name) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -162,7 +159,7 @@ export class RemixAppManager extends PluginManager { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async canDeactivatePlugin(from, to) { |
|
|
|
|
if (requiredModules.includes(to.name)) return false |
|
|
|
|
if (this.isRequired(to.name)) return false |
|
|
|
|
return isNative(from.name) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -207,7 +204,7 @@ export class RemixAppManager extends PluginManager { |
|
|
|
|
) |
|
|
|
|
this.event.emit('activate', plugin) |
|
|
|
|
this.emit('activate', plugin) |
|
|
|
|
if (!requiredModules.includes(plugin.name)) _paq.push(['trackEvent', 'pluginManager', 'activate', plugin.name]) |
|
|
|
|
if (!this.isRequired(plugin.name)) _paq.push(['trackEvent', 'pluginManager', 'activate', plugin.name]) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getAll() { |
|
|
|
@ -235,7 +232,7 @@ export class RemixAppManager extends PluginManager { |
|
|
|
|
|
|
|
|
|
isRequired(name) { |
|
|
|
|
// excluding internal use plugins
|
|
|
|
|
return requiredModules.includes(name) |
|
|
|
|
return requiredModules.includes(name) || isInjectedProvicer(name) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async registeredPlugins() { |
|
|
|
|