refactor: use helpers when using the remote module in sandboxed renderers (#15960)
This commit is contained in:
parent
d243a45173
commit
ab2a061b59
11 changed files with 46 additions and 28 deletions
|
@ -274,13 +274,13 @@ const registerWebViewElement = function () {
|
|||
|
||||
// WebContents associated with this webview.
|
||||
proto.getWebContents = function () {
|
||||
const { getRemoteForUsage } = require('@electron/internal/renderer/remote')
|
||||
const remote = getRemoteForUsage('getWebContents()')
|
||||
const { getRemote } = require('@electron/internal/renderer/remote')
|
||||
const getGuestWebContents = getRemote('getGuestWebContents')
|
||||
const internal = v8Util.getHiddenValue(this, 'internal')
|
||||
if (!internal.guestInstanceId) {
|
||||
internal.createGuestSync()
|
||||
}
|
||||
return remote.getGuestWebContents(internal.guestInstanceId)
|
||||
return getGuestWebContents(internal.guestInstanceId)
|
||||
}
|
||||
|
||||
// Focusing the webview should move page focus to the underlying iframe.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue