mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: include permission element string resources in locale paks (#51373)
The `<geolocation>` 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 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -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)) {
|
||||
@@ -186,6 +188,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_",
|
||||
@@ -202,6 +205,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",
|
||||
|
||||
@@ -966,6 +966,17 @@ describe('chromium features', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('<geolocation> 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,<geolocation></geolocation>');
|
||||
});
|
||||
});
|
||||
|
||||
describe('File System API,', () => {
|
||||
let w: BrowserWindow | null = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user