clean native/required plugin list

pull/4761/head
yann300 7 months ago committed by Aniket
parent 367020706d
commit 96af3b3879
  1. 4
      apps/remix-ide-e2e/src/tests/runAndDeploy_injected.test.ts
  2. 23
      apps/remix-ide/src/remixAppManager.js

@ -44,7 +44,7 @@ module.exports = {
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.click('*[data-id="landingPageStartSolidity"]')
.clickLaunchIcon('udapp')
.switchEnvironment('MetaMask')
.switchEnvironment('injected-MetaMask')
.waitForElementPresent('*[data-id="settingsNetworkEnv"]')
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Sepolia (11155111) network')
.pause(5000)
@ -123,7 +123,7 @@ module.exports = {
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
.click('*[data-id="landingPageStartSolidity"]')
.clickLaunchIcon('udapp')
.switchEnvironment('MetaMask')
.switchEnvironment('injected-MetaMask')
.waitForElementPresent('*[data-id="settingsNetworkEnv"]')
.assert.containsText('*[data-id="settingsNetworkEnv"]', 'Main (1) network')
},

@ -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() {

Loading…
Cancel
Save