feat: redesign preload APIs (#45329)
* feat: redesign preload APIs Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * docs: remove service-worker mentions for now Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * fix lint Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * remove service-worker ipc code Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * add filename Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * fix: web preferences preload not included Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * fix: missing common init Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> * fix: preload bundle script error Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Maddock <samuel.maddock@gmail.com>
This commit is contained in:
parent
e9b3e4cc91
commit
9d696ceffe
19 changed files with 459 additions and 149 deletions
7
typings/internal-electron.d.ts
vendored
7
typings/internal-electron.d.ts
vendored
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue