mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: delete temporary blink* globals after restoring Blink implementations (#49999)
ElectronRendererClient::DidCreateScriptContext (and the worker equivalent) save Blink's fetch/Response/FormData/Request/Headers/ EventSource as temporary globalThis.blink* properties before Node initialization may overwrite them. node/init.ts and worker/init.ts restore the originals but previously never deleted the temporary blink* globals. They persisted as non-standard global pollution visible to page content when contextIsolation is disabled -- a minor fingerprinting signal and a bypass for any preload that wraps window.fetch (page could call blinkfetch() instead). Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <sattard@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ if ((globalThis as any).blinkfetch) {
|
||||
const keys = ['fetch', 'Response', 'FormData', 'Request', 'Headers', 'EventSource'];
|
||||
for (const key of keys) {
|
||||
(globalThis as any)[key] = (globalThis as any)[`blink${key}`];
|
||||
delete (globalThis as any)[`blink${key}`];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ if ((globalThis as any).blinkfetch) {
|
||||
const keys = ['fetch', 'Response', 'FormData', 'Request', 'Headers', 'EventSource'];
|
||||
for (const key of keys) {
|
||||
(globalThis as any)[key] = (globalThis as any)[`blink${key}`];
|
||||
delete (globalThis as any)[`blink${key}`];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user