|
@@ -9,7 +9,6 @@ const eventBinding = process.electronBinding('event')
|
|
|
const clipboard = process.electronBinding('clipboard')
|
|
|
const features = process.electronBinding('features')
|
|
|
|
|
|
-const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
|
|
|
const { crashReporterInit } = require('@electron/internal/browser/crash-reporter-init')
|
|
|
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
|
|
const ipcMainUtils = require('@electron/internal/browser/ipc-main-internal-utils')
|
|
@@ -526,13 +525,24 @@ const getPreloadScript = async function (preloadPath) {
|
|
|
return { preloadPath, preloadSrc, preloadError }
|
|
|
}
|
|
|
|
|
|
-ipcMainUtils.handle('ELECTRON_GET_CONTENT_SCRIPTS', () => getContentScripts())
|
|
|
+if (process.electronBinding('features').isExtensionsEnabled()) {
|
|
|
+ ipcMainUtils.handle('ELECTRON_GET_CONTENT_SCRIPTS', () => [])
|
|
|
+} else {
|
|
|
+ const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
|
|
|
+ ipcMainUtils.handle('ELECTRON_GET_CONTENT_SCRIPTS', () => getContentScripts())
|
|
|
+}
|
|
|
|
|
|
ipcMainUtils.handle('ELECTRON_BROWSER_SANDBOX_LOAD', async function (event) {
|
|
|
const preloadPaths = event.sender._getPreloadPaths()
|
|
|
|
|
|
+ let contentScripts = []
|
|
|
+ if (!process.electronBinding('features').isExtensionsEnabled()) {
|
|
|
+ const { getContentScripts } = require('@electron/internal/browser/chrome-extension')
|
|
|
+ contentScripts = getContentScripts()
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
- contentScripts: getContentScripts(),
|
|
|
+ contentScripts,
|
|
|
preloadScripts: await Promise.all(preloadPaths.map(path => getPreloadScript(path))),
|
|
|
isRemoteModuleEnabled: isRemoteModuleEnabled(event.sender),
|
|
|
isWebViewTagEnabled: guestViewManager.isWebViewTagEnabled(event.sender),
|