refactor: use helpers when using the remote module in sandboxed renderers (#15960)

This commit is contained in:
Milan Burda 2018-12-05 19:07:32 +01:00 committed by Shelley Vohr
parent d243a45173
commit ab2a061b59
11 changed files with 46 additions and 28 deletions

View file

@ -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.