try catch missing extension
This commit is contained in:
parent
3f00dba937
commit
c3d8f4090e
|
@ -39,13 +39,15 @@ export default new class ReactDevtoolsModule extends BuiltinModule {
|
|||
devToolsOpened() {
|
||||
electron.remote.BrowserWindow.removeDevToolsExtension('React Developer Tools');
|
||||
electron.webFrame.registerURLSchemeAsPrivileged('chrome-extension');
|
||||
const v = electron.remote.BrowserWindow.addDevToolsExtension(path.resolve(Globals.getPath('ext'), 'extensions', 'rdt'));
|
||||
if (v !== undefined) {
|
||||
Toasts.success(v + ' Installed');
|
||||
return;
|
||||
} else {
|
||||
try {
|
||||
const res = electron.remote.BrowserWindow.addDevToolsExtension(path.resolve(Globals.getPath('ext'), 'extensions', 'rdt'));
|
||||
if (res !== undefined) {
|
||||
Toasts.success(res + ' Installed');
|
||||
return;
|
||||
}
|
||||
Toasts.error('React Developer Tools install failed');
|
||||
} catch (err) {
|
||||
Toasts.error('React Developer Tools install failed');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,13 +39,15 @@ export default new class VueDevtoolsModule extends BuiltinModule {
|
|||
devToolsOpened() {
|
||||
electron.remote.BrowserWindow.removeDevToolsExtension('Vue.js devtools');
|
||||
electron.webFrame.registerURLSchemeAsPrivileged('chrome-extension');
|
||||
const v = electron.remote.BrowserWindow.addDevToolsExtension(path.resolve(Globals.getPath('ext'), 'extensions', 'vdt'));
|
||||
if (v !== undefined) {
|
||||
Toasts.success(v + ' Installed');
|
||||
return;
|
||||
} else {
|
||||
try {
|
||||
const res = electron.remote.BrowserWindow.addDevToolsExtension(path.resolve(Globals.getPath('ext'), 'extensions', 'vdt'));
|
||||
if (res !== undefined) {
|
||||
Toasts.success(res + ' Installed');
|
||||
return;
|
||||
}
|
||||
Toasts.error('Vue.js devtools install failed');
|
||||
} catch (err) {
|
||||
Toasts.error('Vue.js devtools install failed');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,14 +68,14 @@
|
|||
"id": "react-devtools",
|
||||
"type": "bool",
|
||||
"text": "React Developer Tools",
|
||||
"hint": "Enable/Disable React developer tools",
|
||||
"hint": "Place extension in ext/extensions",
|
||||
"value": false
|
||||
},
|
||||
{
|
||||
"id": "vue-devtools",
|
||||
"type": "bool",
|
||||
"text": "Vue Developer Tools",
|
||||
"hint": "Enable/Disable Vue developer tools",
|
||||
"hint": "Place extension in ext/extensions",
|
||||
"value": false
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue