diff --git a/lib/browser/api/screen.ts b/lib/browser/api/screen.ts index 6f2418223bb..d3e9aaee3d7 100644 --- a/lib/browser/api/screen.ts +++ b/lib/browser/api/screen.ts @@ -16,5 +16,23 @@ export default new Proxy({}, { return v.bind(_screen); } return v; + }, + ownKeys: () => { + if (_screen === undefined) { + _screen = createScreen(); + } + return Reflect.ownKeys(_screen); + }, + has: (target, prop: string) => { + if (_screen === undefined) { + _screen = createScreen(); + } + return prop in _screen; + }, + getOwnPropertyDescriptor: (target, prop: string) => { + if (_screen === undefined) { + _screen = createScreen(); + } + return Reflect.getOwnPropertyDescriptor(_screen, prop); } });