electron-extension-installer
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -95,2 +95,11 @@ "use strict"; | ||
} | ||
const isManifestVersion3 = async (manifestDirectory) => { | ||
try { | ||
const file = await fs_jetpack_1.default.readAsync(path.join(manifestDirectory, "manifest.json"), "json"); | ||
return file.manifest_version === 3; | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
}; | ||
/** | ||
@@ -137,2 +146,10 @@ * @param extensionReference Extension or extensions to install | ||
} | ||
if (await isManifestVersion3(extensionFolder)) { | ||
throw new Error(`Manifest version 3 is not supported by electron. For more information, see: | ||
https://github.com/facebook/react/issues/25843 | ||
https://github.com/electron/electron/issues/37876 | ||
https://github.com/MarshallOfSound/electron-devtools-installer/issues/238 | ||
https://github.com/electron/electron/blob/e3b7c3024f6f70155efb1022b691954280f983cb/docs/api/extensions.md#L1`); | ||
} | ||
const ext = await electron_1.session.defaultSession.loadExtension(extensionFolder, loadExtensionOptions); | ||
@@ -139,0 +156,0 @@ return ext.name; |
{ | ||
"name": "electron-extension-installer", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "author": "Jonluca DeCaro <electronextension@jonlu.ca>", |
@@ -92,2 +92,11 @@ import type { LoadExtensionOptions } from "electron"; | ||
const isManifestVersion3 = async (manifestDirectory: string) => { | ||
try { | ||
const file = await jetpack.readAsync(path.join(manifestDirectory, "manifest.json"), "json"); | ||
return file.manifest_version === 3; | ||
} catch (e) { | ||
return false; | ||
} | ||
}; | ||
/** | ||
@@ -143,2 +152,10 @@ * @param extensionReference Extension or extensions to install | ||
if (await isManifestVersion3(extensionFolder)) { | ||
throw new Error(`Manifest version 3 is not supported by electron. For more information, see: | ||
https://github.com/facebook/react/issues/25843 | ||
https://github.com/electron/electron/issues/37876 | ||
https://github.com/MarshallOfSound/electron-devtools-installer/issues/238 | ||
https://github.com/electron/electron/blob/e3b7c3024f6f70155efb1022b691954280f983cb/docs/api/extensions.md#L1`); | ||
} | ||
const ext = await session.defaultSession.loadExtension(extensionFolder, loadExtensionOptions); | ||
@@ -145,0 +162,0 @@ return ext.name; |
31508
733