fix: `chrome://process-internals` failing to load (#41540)

fix: chrome://process-internals failing to load

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
trop[bot] 2024-03-12 20:35:58 +01:00 коммит произвёл GitHub
Родитель 35099d9289
Коммит d3b182f8b9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -77,6 +77,7 @@ template("electron_extra_paks") {
"//content:content_resources",
"//content/browser/resources/gpu:resources",
"//content/browser/resources/media:resources",
"//content/browser/resources/process:resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//electron:resources",
@ -96,6 +97,7 @@ template("electron_extra_paks") {
# New paks should be added here by default.
sources += [
"$root_gen_dir/content/browser/devtools/devtools_resources.pak",
"$root_gen_dir/content/process_resources.pak",
"$root_gen_dir/ui/resources/webui_resources.pak",
]
deps += [ "//content/browser/devtools:devtools_resources" ]

Просмотреть файл

@ -2113,7 +2113,8 @@ describe('chromium features', () => {
'chrome://gpu',
'chrome://media-internals',
'chrome://tracing',
'chrome://webrtc-internals'
'chrome://webrtc-internals',
'chrome://process-internals'
];
for (const url of urls) {
@ -2121,8 +2122,9 @@ describe('chromium features', () => {
it('loads the page successfully', async () => {
const w = new BrowserWindow({ show: false });
await w.loadURL(url);
const host = url.substring('chrome://'.length);
const pageExists = await w.webContents.executeJavaScript(
"window.hasOwnProperty('chrome') && window.chrome.hasOwnProperty('send')"
`window.hasOwnProperty('chrome') && window.location.host === '${host}'`
);
expect(pageExists).to.be.true();
});