Convert targetOrigin to string in render process
This commit is contained in:
parent
3894c1c625
commit
246937a372
2 changed files with 12 additions and 1 deletions
|
@ -32,6 +32,9 @@ const resolveURL = function (url) {
|
|||
return a.href
|
||||
}
|
||||
|
||||
// Use this method to ensure value expected as string in the main process
|
||||
// are convertible to string in the renderer process. This ensures exceptions
|
||||
// converting values to string are thrown in this process.
|
||||
const toString = (value) => {
|
||||
return value != null ? `${value}` : value
|
||||
}
|
||||
|
@ -86,7 +89,7 @@ function BrowserWindowProxy (ipcRenderer, guestId) {
|
|||
}
|
||||
|
||||
this.postMessage = (message, targetOrigin) => {
|
||||
ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', guestId, message, targetOrigin, window.location.origin)
|
||||
ipcRenderer.send('ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_POSTMESSAGE', guestId, message, toString(targetOrigin), window.location.origin)
|
||||
}
|
||||
|
||||
this.eval = (...args) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue