mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
Improve inPageCallback handling
This patch improves inPageCallback handling so that it doesn't retain any variables.
This commit is contained in:
parent
549535e674
commit
7136b3aaff
@ -128,9 +128,11 @@ class Page extends EventEmitter {
|
||||
function inPageCallback(callbackName) {
|
||||
window[callbackName] = (...args) => {
|
||||
window[callbackName].__args = args;
|
||||
window[callbackName].__result = undefined;
|
||||
debugger;
|
||||
return window[callbackName].__result;
|
||||
var result = window[callbackName].__result;
|
||||
delete window[callbackName].__result;
|
||||
delete window[callbackName].__args;
|
||||
return result;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user