fix undefined
This commit is contained in:
parent
f08364edcd
commit
ff527d9732
1 changed files with 10 additions and 9 deletions
|
|
@ -691,28 +691,29 @@ function __uvHook(window, config = {}, bare = '/bare/') {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const contentWindowGet = Object.getOwnPropertyDescriptor(
|
||||||
|
HTMLIFrameElement.prototype,
|
||||||
|
'contentWindow'
|
||||||
|
).get;
|
||||||
|
|
||||||
client.element.hookProperty(HTMLIFrameElement, 'contentWindow', {
|
client.element.hookProperty(HTMLIFrameElement, 'contentWindow', {
|
||||||
get: (target, that) => {
|
get: (target, that) => {
|
||||||
const win = target.call(that);
|
const win = target.call(that);
|
||||||
try {
|
try {
|
||||||
if (!win.__uv) __uvHook(win, config, bare);
|
if (!win.__uv) __uvHook(win, config, bare);
|
||||||
|
} catch (e) {}
|
||||||
return win;
|
return win;
|
||||||
} catch (e) {
|
|
||||||
return win;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
client.element.hookProperty(HTMLIFrameElement, 'contentDocument', {
|
client.element.hookProperty(HTMLIFrameElement, 'contentDocument', {
|
||||||
get: (target, that) => {
|
get: (target, that) => {
|
||||||
|
const win = contentWindowGet.call(that);
|
||||||
const doc = target.call(that);
|
const doc = target.call(that);
|
||||||
try {
|
try {
|
||||||
const win = doc.defaultView;
|
|
||||||
if (!win.__uv) __uvHook(win, config, bare);
|
if (!win.__uv) __uvHook(win, config, bare);
|
||||||
|
} catch (e) {}
|
||||||
return doc;
|
return doc;
|
||||||
} catch (e) {
|
|
||||||
return win;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue