mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
JS -- Send events to the sandbox from annotation layer
This commit is contained in:
parent
640a08444c
commit
6502ae889d
11 changed files with 647 additions and 113 deletions
|
@ -47,6 +47,7 @@ class AnnotationLayerBuilder {
|
|||
l10n = NullL10n,
|
||||
enableScripting = false,
|
||||
hasJSActionsPromise = null,
|
||||
mouseState = null,
|
||||
}) {
|
||||
this.pageDiv = pageDiv;
|
||||
this.pdfPage = pdfPage;
|
||||
|
@ -58,6 +59,7 @@ class AnnotationLayerBuilder {
|
|||
this.annotationStorage = annotationStorage;
|
||||
this.enableScripting = enableScripting;
|
||||
this._hasJSActionsPromise = hasJSActionsPromise;
|
||||
this._mouseState = mouseState;
|
||||
|
||||
this.div = null;
|
||||
this._cancelled = false;
|
||||
|
@ -93,6 +95,7 @@ class AnnotationLayerBuilder {
|
|||
annotationStorage: this.annotationStorage,
|
||||
enableScripting: this.enableScripting,
|
||||
hasJSActions,
|
||||
mouseState: this._mouseState,
|
||||
};
|
||||
|
||||
if (this.div) {
|
||||
|
@ -139,6 +142,7 @@ class DefaultAnnotationLayerFactory {
|
|||
* @param {IL10n} l10n
|
||||
* @param {boolean} [enableScripting]
|
||||
* @param {Promise<boolean>} [hasJSActionsPromise]
|
||||
* @param {Object} [mouseState]
|
||||
* @returns {AnnotationLayerBuilder}
|
||||
*/
|
||||
createAnnotationLayerBuilder(
|
||||
|
@ -149,7 +153,8 @@ class DefaultAnnotationLayerFactory {
|
|||
renderInteractiveForms = true,
|
||||
l10n = NullL10n,
|
||||
enableScripting = false,
|
||||
hasJSActionsPromise = null
|
||||
hasJSActionsPromise = null,
|
||||
mouseState = null
|
||||
) {
|
||||
return new AnnotationLayerBuilder({
|
||||
pageDiv,
|
||||
|
@ -161,6 +166,7 @@ class DefaultAnnotationLayerFactory {
|
|||
annotationStorage,
|
||||
enableScripting,
|
||||
hasJSActionsPromise,
|
||||
mouseState,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue