UNPKG

1.01 kBJavaScriptView Raw
1const electron = require('electron')
2
3exports.install = () => {
4 if (process.type === 'renderer') {
5 console.log(`Installing Vue Devtools from ${__dirname}`)
6 return electron.remote.BrowserWindow.addDevToolsExtension(__dirname)
7 } else if (process.type === 'browser') {
8 console.log(`Installing Vue Devtools from ${__dirname}`)
9 return electron.BrowserWindow.addDevToolsExtension(__dirname)
10 } else {
11 throw new Error('Vue Devtools can only be installed from an Electron process.')
12 }
13}
14
15exports.uninstall = () => {
16 if (process.type === 'renderer') {
17 console.log(`Uninstalling Vue Devtools from ${__dirname}`)
18 return electron.remote.BrowserWindow.removeDevToolsExtension('devtron')
19 } else if (process.type === 'browser') {
20 console.log(`Uninstalling Vue Devtools from ${__dirname}`)
21 return electron.BrowserWindow.removeDevToolsExtension('devtron')
22 } else {
23 throw new Error('Vue Devtools can only be uninstalled from an Electron process.')
24 }
25}
26
27exports.path = __dirname