fix: crash when loading extension with missing manifest (#34168)
* fix: crash when loading extension missing manifest * Update electron_paks.gni Co-authored-by: Robo <hop2deep@gmail.com> Co-authored-by: Robo <hop2deep@gmail.com>
This commit is contained in:
parent
4f8a843606
commit
d67532ee9f
3 changed files with 9 additions and 0 deletions
|
@ -183,6 +183,7 @@ template("electron_paks") {
|
||||||
"${root_gen_dir}/components/strings/components_locale_settings_",
|
"${root_gen_dir}/components/strings/components_locale_settings_",
|
||||||
"${root_gen_dir}/components/strings/components_strings_",
|
"${root_gen_dir}/components/strings/components_strings_",
|
||||||
"${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
|
"${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
|
||||||
|
"${root_gen_dir}/extensions/strings/extensions_strings_",
|
||||||
"${root_gen_dir}/services/strings/services_strings_",
|
"${root_gen_dir}/services/strings/services_strings_",
|
||||||
"${root_gen_dir}/third_party/blink/public/strings/blink_accessibility_strings_",
|
"${root_gen_dir}/third_party/blink/public/strings/blink_accessibility_strings_",
|
||||||
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
|
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
|
||||||
|
@ -197,6 +198,7 @@ template("electron_paks") {
|
||||||
"//components/strings:components_locale_settings",
|
"//components/strings:components_locale_settings",
|
||||||
"//components/strings:components_strings",
|
"//components/strings:components_strings",
|
||||||
"//device/bluetooth/strings",
|
"//device/bluetooth/strings",
|
||||||
|
"//extensions/strings",
|
||||||
"//services/strings",
|
"//services/strings",
|
||||||
"//third_party/blink/public/strings",
|
"//third_party/blink/public/strings",
|
||||||
"//third_party/blink/public/strings:accessibility_strings",
|
"//third_party/blink/public/strings:accessibility_strings",
|
||||||
|
|
|
@ -110,6 +110,12 @@ describe('chrome extensions', () => {
|
||||||
expect(bg).to.equal('red');
|
expect(bg).to.equal('red');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not crash when loading an extension with missing manifest', async () => {
|
||||||
|
const customSession = session.fromPartition(`persist:${uuid.v4()}`);
|
||||||
|
const promise = customSession.loadExtension(path.join(fixtures, 'extensions', 'missing-manifest'));
|
||||||
|
await expect(promise).to.eventually.be.rejectedWith(/Manifest file is missing or unreadable/);
|
||||||
|
});
|
||||||
|
|
||||||
it('does not crash when failing to load an extension', async () => {
|
it('does not crash when failing to load an extension', async () => {
|
||||||
const customSession = session.fromPartition(`persist:${uuid.v4()}`);
|
const customSession = session.fromPartition(`persist:${uuid.v4()}`);
|
||||||
const promise = customSession.loadExtension(path.join(fixtures, 'extensions', 'load-error'));
|
const promise = customSession.loadExtension(path.join(fixtures, 'extensions', 'load-error'));
|
||||||
|
|
1
spec-main/fixtures/extensions/missing-manifest/main.js
Normal file
1
spec-main/fixtures/extensions/missing-manifest/main.js
Normal file
|
@ -0,0 +1 @@
|
||||||
|
console.log('oh no where is my manifest');
|
Loading…
Reference in a new issue