conditional reference to HTMLIFrameElement
This will prevent an exception being thrown in workers.
This commit is contained in:
parent
26d17cd241
commit
602414a586
1 changed files with 7 additions and 4 deletions
|
|
@ -700,10 +700,13 @@ function __uvHook(window, config = {}, bare = '/bare/') {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const contentWindowGet = Object.getOwnPropertyDescriptor(
|
// HTMLIFrameElement may not be defined (workers)
|
||||||
HTMLIFrameElement.prototype,
|
const contentWindowGet =
|
||||||
'contentWindow'
|
HTMLIFrameElement &&
|
||||||
).get;
|
Object.getOwnPropertyDescriptor(
|
||||||
|
HTMLIFrameElement.prototype,
|
||||||
|
'contentWindow'
|
||||||
|
).get;
|
||||||
|
|
||||||
function uvInject(that) {
|
function uvInject(that) {
|
||||||
const win = contentWindowGet.call(that);
|
const win = contentWindowGet.call(that);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue