chore: make rpc-server reply to sender frame instead of the main frame (#15973)
* chore: make rpc-server reply to frame * fix: check IsRenderFrameLive
This commit is contained in:
parent
eb8fcf833c
commit
db2fda1b6f
5 changed files with 51 additions and 10 deletions
|
@ -142,6 +142,18 @@ WebContents.prototype._sendInternalToAll = function (channel, ...args) {
|
|||
|
||||
return this._send(internal, sendToAll, channel, args)
|
||||
}
|
||||
WebContents.prototype._sendToFrameInternal = function (frameId, channel, ...args) {
|
||||
if (typeof channel !== 'string') {
|
||||
throw new Error('Missing required channel argument')
|
||||
} else if (typeof frameId !== 'number') {
|
||||
throw new Error('Missing required frameId argument')
|
||||
}
|
||||
|
||||
const internal = true
|
||||
const sendToAll = false
|
||||
|
||||
return this._sendToFrame(internal, sendToAll, frameId, channel, args)
|
||||
}
|
||||
|
||||
// Following methods are mapped to webFrame.
|
||||
const webFrameMethods = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue