feat: add webFrameMain.send() / webFrameMain.postMessage() (#26807)
This commit is contained in:
parent
28b6579538
commit
2be3d03630
14 changed files with 340 additions and 209 deletions
8
typings/internal-electron.d.ts
vendored
8
typings/internal-electron.d.ts
vendored
|
@ -68,9 +68,7 @@ declare namespace Electron {
|
|||
_callWindowOpenHandler(event: any, url: string, frameName: string, rawFeatures: string): Electron.BrowserWindowConstructorOptions | null;
|
||||
_setNextChildWebPreferences(prefs: Partial<Electron.BrowserWindowConstructorOptions['webPreferences']> & Pick<Electron.BrowserWindowConstructorOptions, 'backgroundColor'>): void;
|
||||
_send(internal: boolean, channel: string, args: any): boolean;
|
||||
_sendToFrame(internal: boolean, frameId: number | [number, number], channel: string, args: any): boolean;
|
||||
_sendToFrameInternal(frameId: number | [number, number], channel: string, ...args: any[]): boolean;
|
||||
_postMessage(channel: string, message: any, transfer?: any[]): void;
|
||||
_sendInternal(channel: string, ...args: any[]): void;
|
||||
_printToPDF(options: any): Promise<Buffer>;
|
||||
_print(options: any, callback?: (success: boolean, failureReason: string) => void): void;
|
||||
|
@ -93,6 +91,12 @@ declare namespace Electron {
|
|||
allowGuestViewElementDefinition(window: Window, context: any): void;
|
||||
}
|
||||
|
||||
interface WebFrameMain {
|
||||
_send(internal: boolean, channel: string, args: any): void;
|
||||
_sendInternal(channel: string, ...args: any[]): void;
|
||||
_postMessage(channel: string, message: any, transfer?: any[]): void;
|
||||
}
|
||||
|
||||
interface WebPreferences {
|
||||
guestInstanceId?: number;
|
||||
openerId?: number;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue