refactor: enforce naming of ipcMainInternal (#16689)
This commit is contained in:
parent
cacb56b103
commit
af64140100
10 changed files with 45 additions and 43 deletions
|
@ -1,7 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const { webContents } = require('electron')
|
||||
const ipcMain = require('@electron/internal/browser/ipc-main-internal')
|
||||
const { ipcMainInternal } = require('@electron/internal/browser/ipc-main-internal')
|
||||
const parseFeaturesString = require('@electron/internal/common/parse-features-string')
|
||||
const errorUtils = require('@electron/internal/common/error-utils')
|
||||
const {
|
||||
|
@ -341,7 +341,7 @@ const isWebViewTagEnabled = function (contents) {
|
|||
}
|
||||
|
||||
const handleMessage = function (channel, handler) {
|
||||
ipcMain.on(channel, (event, ...args) => {
|
||||
ipcMainInternal.on(channel, (event, ...args) => {
|
||||
if (isWebViewTagEnabled(event.sender)) {
|
||||
handler(event, ...args)
|
||||
} else {
|
||||
|
@ -376,7 +376,7 @@ handleMessage('ELECTRON_GUEST_VIEW_MANAGER_ATTACH_GUEST', function (event, embed
|
|||
})
|
||||
|
||||
// this message is sent by the actual <webview>
|
||||
ipcMain.on('ELECTRON_GUEST_VIEW_MANAGER_FOCUS_CHANGE', function (event, focus, guestInstanceId) {
|
||||
ipcMainInternal.on('ELECTRON_GUEST_VIEW_MANAGER_FOCUS_CHANGE', function (event, focus, guestInstanceId) {
|
||||
const guest = getGuest(guestInstanceId)
|
||||
if (guest === event.sender) {
|
||||
event.sender.emit('focus-change', {}, focus, guestInstanceId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue