fix: set setter of window.location
This commit is contained in:
parent
e80e3a53e9
commit
fc4e10b6c0
2 changed files with 12 additions and 2 deletions
|
@ -103,7 +103,17 @@ function LocationProxy (ipcRenderer, guestId) {
|
|||
|
||||
function BrowserWindowProxy (ipcRenderer, guestId) {
|
||||
this.closed = false
|
||||
this.location = new LocationProxy(ipcRenderer, guestId)
|
||||
|
||||
const location = new LocationProxy(ipcRenderer, guestId)
|
||||
defineProperty(this, 'location', {
|
||||
get: function () {
|
||||
return location
|
||||
},
|
||||
set: function (url) {
|
||||
url = resolveURL(url)
|
||||
return ipcRenderer.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD_SYNC', guestId, 'loadURL', url)
|
||||
}
|
||||
})
|
||||
|
||||
ipcRenderer.once(`ELECTRON_GUEST_WINDOW_MANAGER_WINDOW_CLOSED_${guestId}`, () => {
|
||||
removeProxy(guestId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue