feat: redesign preload APIs (#45230)

* feat: redesign preload APIs

* docs: remove service-worker mentions for now

* fix lint

* remove service-worker ipc code

* add filename

* fix: web preferences preload not included

* fix: missing common init

* fix: preload bundle script error
This commit is contained in:
Sam Maddock
2025-01-23 21:12:23 -05:00
committed by GitHub
parent 26d228ccfe
commit e09577b123
19 changed files with 459 additions and 149 deletions

View File

@@ -76,7 +76,7 @@ declare namespace Electron {
getOwnerBrowserWindow(): Electron.BrowserWindow | null;
getLastWebPreferences(): Electron.WebPreferences | null;
_getProcessMemoryInfo(): Electron.ProcessMemoryInfo;
_getPreloadPaths(): string[];
_getPreloadScript(): Electron.PreloadScript | null;
equal(other: WebContents): boolean;
browserWindowOptions: BrowserWindowConstructorOptions;
_windowOpenHandler: ((details: Electron.HandlerDetails) => any) | null;
@@ -330,6 +330,11 @@ declare namespace ElectronInternal {
class WebContents extends Electron.WebContents {
static create(opts?: Electron.WebPreferences): Electron.WebContents;
}
interface PreloadScript extends Electron.PreloadScript {
contents?: string;
error?: Error;
}
}
declare namespace Chrome {