Merge pull request #19853 from calixteman/issue19850
Disable userActivation before executing a setTimeout/setInterval callback
This commit is contained in:
commit
627a935baf
@ -88,9 +88,10 @@ class App extends PDFObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_evalCallback({ callbackId, interval }) {
|
_evalCallback({ callbackId, interval }) {
|
||||||
|
const documentObj = this._document.obj;
|
||||||
if (callbackId === USERACTIVATION_CALLBACKID) {
|
if (callbackId === USERACTIVATION_CALLBACKID) {
|
||||||
// Special callback id for userActivation stuff.
|
// Special callback id for userActivation stuff.
|
||||||
this._document.obj._userActivation = false;
|
documentObj._userActivation = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const expr = this._timeoutCallbackIds.get(callbackId);
|
const expr = this._timeoutCallbackIds.get(callbackId);
|
||||||
@ -99,7 +100,12 @@ class App extends PDFObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (expr) {
|
if (expr) {
|
||||||
|
const saveUserActivation = documentObj._userActivation;
|
||||||
|
// A setTimeout/setInterval callback is executed so it can't be a user
|
||||||
|
// choice.
|
||||||
|
documentObj._userActivation = false;
|
||||||
this._globalEval(expr);
|
this._globalEval(expr);
|
||||||
|
documentObj._userActivation = saveUserActivation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user