2020-03-20 20:28:31 +00:00
|
|
|
'use strict';
|
2017-01-12 00:36:59 +00:00
|
|
|
|
2018-12-13 21:25:12 +00:00
|
|
|
/* global nodeProcess, isolatedWorld */
|
2018-09-22 12:28:50 +00:00
|
|
|
|
2020-03-20 20:28:31 +00:00
|
|
|
process.electronBinding = require('@electron/internal/common/electron-binding-setup').electronBindingSetup(nodeProcess._linkedBinding, 'renderer');
|
2017-01-12 00:36:59 +00:00
|
|
|
|
2020-03-20 20:28:31 +00:00
|
|
|
const v8Util = process.electronBinding('v8_util');
|
2019-03-30 01:10:21 +00:00
|
|
|
|
|
|
|
// The `lib/renderer/ipc-renderer-internal.js` module looks for the ipc object in the
|
|
|
|
// "ipc-internal" hidden value
|
2020-03-20 20:28:31 +00:00
|
|
|
v8Util.setHiddenValue(global, 'ipc-internal', v8Util.getHiddenValue(isolatedWorld, 'ipc-internal'));
|
2019-01-22 01:08:16 +00:00
|
|
|
|
2020-03-20 20:28:31 +00:00
|
|
|
const webViewImpl = v8Util.getHiddenValue(isolatedWorld, 'web-view-impl');
|
2019-01-12 01:00:43 +00:00
|
|
|
|
|
|
|
if (webViewImpl) {
|
|
|
|
// Must setup the WebView element in main world.
|
2020-03-20 20:28:31 +00:00
|
|
|
const { setupWebView } = require('@electron/internal/renderer/web-view/web-view-element');
|
|
|
|
setupWebView(v8Util, webViewImpl);
|
2019-01-12 01:00:43 +00:00
|
|
|
}
|
2017-01-12 00:36:59 +00:00
|
|
|
|
2020-03-20 20:28:31 +00:00
|
|
|
const isolatedWorldArgs = v8Util.getHiddenValue(isolatedWorld, 'isolated-world-args');
|
2019-01-22 01:08:16 +00:00
|
|
|
|
|
|
|
if (isolatedWorldArgs) {
|
2020-03-20 20:28:31 +00:00
|
|
|
const { guestInstanceId, isHiddenPage, openerId, usesNativeWindowOpen, rendererProcessReuseEnabled } = isolatedWorldArgs;
|
|
|
|
const { windowSetup } = require('@electron/internal/renderer/window-setup');
|
|
|
|
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen, rendererProcessReuseEnabled);
|
2019-01-22 01:08:16 +00:00
|
|
|
}
|