refactor: use ipcMainUtils.invokeInWebContents / ipcRendererUtils.handle helpers for Chrome APIs (#17417)
This commit is contained in:
parent
546466b209
commit
336db33d18
9 changed files with 82 additions and 99 deletions
|
@ -105,7 +105,6 @@ function preloadRequire (module) {
|
|||
// Process command line arguments.
|
||||
const { hasSwitch } = process.electronBinding('command_line')
|
||||
|
||||
const isBackgroundPage = hasSwitch('background-page')
|
||||
const contextIsolation = hasSwitch('context-isolation')
|
||||
|
||||
switch (window.location.protocol) {
|
||||
|
@ -116,7 +115,7 @@ 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, isBackgroundPage, window)
|
||||
require('@electron/internal/renderer/chrome-api').injectTo(window.location.hostname, window)
|
||||
break
|
||||
}
|
||||
case 'chrome': {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue