Merge pull request #4961 from ethereum/matomoplugin

add matomo plugin
pull/5370/head
bunsenstraat 5 months ago committed by GitHub
commit 7bb322a34a
  1. 10
      apps/remix-ide/src/app.js
  2. 26
      apps/remix-ide/src/app/plugins/matomo.ts
  3. 3
      apps/remix-ide/src/remixAppManager.js

@ -56,6 +56,7 @@ import { xtermPlugin } from './app/plugins/electron/xtermPlugin'
import { ripgrepPlugin } from './app/plugins/electron/ripgrepPlugin'
import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins/electron/compilerLoaderPlugin'
import { GitPlugin } from './app/plugins/git'
import { Matomo } from './app/plugins/matomo'
import {SolCoder} from './app/plugins/solcoderAI'
@ -223,6 +224,9 @@ class AppComponent {
//---- git
const git = new GitPlugin()
//---- matomo
const matomo = new Matomo()
//---------------- Solidity UML Generator -------------------------
const solidityumlgen = new SolidityUmlGen(appManager)
@ -357,7 +361,8 @@ class AppComponent {
templates,
solcoder,
git,
pluginStateLogger
pluginStateLogger,
matomo
])
//---- fs plugin
@ -476,7 +481,8 @@ class AppComponent {
'network',
'web3Provider',
'offsetToLineColumnConverter',
'pluginStateLogger'
'pluginStateLogger',
'matomo'
])
await this.appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs'])
await this.appManager.activatePlugin(['statusBar'])

@ -0,0 +1,26 @@
'use strict'
import { Plugin } from '@remixproject/engine'
const _paq = window._paq = window._paq || []
const profile = {
name: 'matomo',
description: 'send analytics to Matomo',
methods: ['track'],
events: [''],
version: '1.0.0'
}
const allowedPlugins = ['LearnEth', 'etherscan', 'vyper', 'circuit-compiler', 'doc-gen', 'doc-viewer', 'solhint', 'walletconnect', 'scriptRunner']
export class Matomo extends Plugin {
constructor() {
super(profile)
}
async track(data: string[]) {
if (!allowedPlugins.includes(this.currentRequest.from)) return
_paq.push(data)
}
}

@ -81,7 +81,8 @@ let requiredModules = [ // services + layout views + system views
'dgit',
'pinnedPanel',
'pluginStateLogger',
'remixGuide'
'remixGuide',
'matomo'
]

Loading…
Cancel
Save