mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
chore: disable JS impl when //extensions support is on (#19512)
This commit is contained in:
@@ -101,7 +101,9 @@ switch (window.location.protocol) {
|
||||
}
|
||||
case 'chrome-extension:': {
|
||||
// Inject the chrome.* APIs that chrome extensions require
|
||||
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window)
|
||||
if (!process.electronBinding('features').isExtensionsEnabled()) {
|
||||
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window)
|
||||
}
|
||||
break
|
||||
}
|
||||
case 'chrome:':
|
||||
@@ -112,8 +114,10 @@ switch (window.location.protocol) {
|
||||
windowSetup(guestInstanceId, openerId, isHiddenPage, usesNativeWindowOpen)
|
||||
|
||||
// Inject content scripts.
|
||||
const contentScripts = ipcRendererUtils.invokeSync('ELECTRON_GET_CONTENT_SCRIPTS') as Electron.ContentScriptEntry[]
|
||||
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
|
||||
if (!process.electronBinding('features').isExtensionsEnabled()) {
|
||||
const contentScripts = ipcRendererUtils.invokeSync('ELECTRON_GET_CONTENT_SCRIPTS') as Electron.ContentScriptEntry[]
|
||||
require('@electron/internal/renderer/content-scripts-injector')(contentScripts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user