From dab9a88413eb590a76d33081320fdb793d1af1c1 Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Thu, 6 May 2021 22:55:32 +0200 Subject: [PATCH] refactor: invoke loadURL in SrcAttribute instead of sending IPC directly (#29031) --- lib/renderer/web-view/web-view-attributes.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/renderer/web-view/web-view-attributes.ts b/lib/renderer/web-view/web-view-attributes.ts index 36d81e106468..1a4a73942c51 100644 --- a/lib/renderer/web-view/web-view-attributes.ts +++ b/lib/renderer/web-view/web-view-attributes.ts @@ -1,7 +1,5 @@ -import { ipcRendererInternal } from '@electron/internal/renderer/ipc-renderer-internal'; import { WebViewImpl } from '@electron/internal/renderer/web-view/web-view-impl'; import { WEB_VIEW_CONSTANTS } from '@electron/internal/renderer/web-view/web-view-constants'; -import { IPC_MESSAGES } from '@electron/internal/common/ipc-messages'; const resolveURL = function (url?: string | null) { return url ? new URL(url, location.href).href : ''; @@ -188,11 +186,7 @@ export class SrcAttribute extends WebViewAttribute { opts.userAgent = useragent; } - const guestInstanceId = this.webViewImpl.guestInstanceId; - const method = 'loadURL'; - const args = [this.getValue(), opts]; - - ipcRendererInternal.invoke(IPC_MESSAGES.GUEST_VIEW_MANAGER_CALL, guestInstanceId, method, args); + (this.webViewImpl.webviewNode as Electron.WebviewTag).loadURL(this.getValue(), opts); } }