From cef313a1724d9f5edba5e05c9ec7d3db70ea864c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 28 Apr 2026 13:25:30 -0500 Subject: [PATCH] fix: include permission element string resources in locale paks (#51346) The `` HTML element looks up IDS_PERMISSION_REQUEST_GEOLOCATION via ResourceBundle::GetLocalizedString(). These string IDs are defined in third_party/blink/public/strings/permission_element_strings.grd. Electron didn't include that in its pak file, causing CHECK(!data->empty()). Ths PR adds the per-locale permission_element_strings paks and the aggregated permission_element_generated_strings pak to electron_paks.gni. This matches how it's done in `chrome/chrome_repack_locales.gni` and in `chrome/chrome_paks.gni`. Xref: https://chromium-review.googlesource.com/c/chromium/src/+/5907626 --- build/electron_paks.gni | 4 ++++ spec/chromium-spec.ts | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/build/electron_paks.gni b/build/electron_paks.gni index 36663da20e..70e8f6583e 100644 --- a/build/electron_paks.gni +++ b/build/electron_paks.gni @@ -65,6 +65,7 @@ template("electron_extra_paks") { "$root_gen_dir/net/net_resources.pak", "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak", "$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak", + "$root_gen_dir/third_party/blink/public/strings/permission_element_generated_strings.pak", "$target_gen_dir/electron_resources.pak", ] deps = [ @@ -83,6 +84,7 @@ template("electron_extra_paks") { "//net:net_resources", "//third_party/blink/public:devtools_inspector_resources", "//third_party/blink/public:resources", + "//third_party/blink/public/strings:permission_element_generated_strings", "//ui/webui/resources", ] if (defined(invoker.deps)) { @@ -187,6 +189,7 @@ template("electron_paks") { "${root_gen_dir}/extensions/strings/extensions_strings_", "${root_gen_dir}/services/strings/services_strings_", "${root_gen_dir}/third_party/blink/public/strings/blink_strings_", + "${root_gen_dir}/third_party/blink/public/strings/permission_element_strings_", "${root_gen_dir}/ui/strings/app_locale_settings_", "${root_gen_dir}/ui/strings/auto_image_annotation_strings_", "${root_gen_dir}/ui/strings/ax_strings_", @@ -204,6 +207,7 @@ template("electron_paks") { "//extensions/strings", "//services/strings", "//third_party/blink/public/strings", + "//third_party/blink/public/strings:permission_element_strings", "//ui/strings:app_locale_settings", "//ui/strings:auto_image_annotation_strings", "//ui/strings:ax_strings", diff --git a/spec/chromium-spec.ts b/spec/chromium-spec.ts index c1b96375e6..22ba16ef90 100644 --- a/spec/chromium-spec.ts +++ b/spec/chromium-spec.ts @@ -1118,6 +1118,17 @@ describe('chromium features', () => { }); }); + describe(' element', () => { + afterEach(closeAllWindows); + + it('does not crash the renderer', (done) => { + const w = new BrowserWindow({ show: false }); + w.webContents.once('did-finish-load', () => done()); + w.webContents.once('render-process-gone', () => done(new Error('renderer crashed / was killed'))); + w.loadURL('data:text/html,'); + }); + }); + describe('File System API,', () => { let w: BrowserWindow | null = null;