fix: refactoring regression in LocationProxy (#19495)
This commit is contained in:
parent
4838bd7834
commit
8a33118e36
2 changed files with 22 additions and 2 deletions
|
@ -64,12 +64,12 @@ class LocationProxy {
|
|||
*/
|
||||
private static ProxyProperty<T> (target: LocationProxy, propertyKey: LocationProperties) {
|
||||
Object.defineProperty(target, propertyKey, {
|
||||
get: function (): T | string {
|
||||
get: function (this: LocationProxy): T | string {
|
||||
const guestURL = this.getGuestURL()
|
||||
const value = guestURL ? guestURL[propertyKey] : ''
|
||||
return value === undefined ? '' : value
|
||||
},
|
||||
set: function (newVal: T) {
|
||||
set: function (this: LocationProxy, newVal: T) {
|
||||
const guestURL = this.getGuestURL()
|
||||
if (guestURL) {
|
||||
// TypeScript doesn't want us to assign to read-only variables.
|
||||
|
@ -105,6 +105,10 @@ class LocationProxy {
|
|||
return null
|
||||
}
|
||||
|
||||
private _invokeWebContentsMethod (method: string, ...args: any[]) {
|
||||
return ipcRendererUtils.invoke('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', this.guestId, method, ...args)
|
||||
}
|
||||
|
||||
private _invokeWebContentsMethodSync (method: string, ...args: any[]) {
|
||||
return ipcRendererUtils.invokeSync('ELECTRON_GUEST_WINDOW_MANAGER_WEB_CONTENTS_METHOD', this.guestId, method, ...args)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue