mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Add back BrowserWindowProxy location property
This commit is contained in:
@@ -31,6 +31,16 @@ const removeProxy = (guestId) => {
|
||||
function BrowserWindowProxy (ipcRenderer, guestId) {
|
||||
this.closed = false
|
||||
|
||||
defineProperty(this, 'location', {
|
||||
get: function () {
|
||||
return ipcRenderer.sendSync('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD_SYNC', guestId, 'getURL')
|
||||
},
|
||||
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)
|
||||
this.closed = true
|
||||
|
||||
Reference in New Issue
Block a user