mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
JS - Add the basic architecture to be able to execute embedded js
This commit is contained in:
parent
a373137304
commit
e76a96892a
18 changed files with 823 additions and 0 deletions
|
@ -254,6 +254,18 @@ class FirefoxComDataRangeTransport extends PDFDataRangeTransport {
|
|||
}
|
||||
}
|
||||
|
||||
const FirefoxScripting = {
|
||||
createSandbox(data) {
|
||||
FirefoxCom.requestSync("createSandbox", data);
|
||||
},
|
||||
dispatchEventInSandbox(event, sandboxID) {
|
||||
FirefoxCom.requestSync("dispatchEventInSandbox", event);
|
||||
},
|
||||
destroySandbox() {
|
||||
FirefoxCom.requestSync("destroySandbox", null);
|
||||
},
|
||||
};
|
||||
|
||||
class FirefoxExternalServices extends DefaultExternalServices {
|
||||
static updateFindControlState(data) {
|
||||
FirefoxCom.request("updateFindControlState", data);
|
||||
|
@ -346,6 +358,10 @@ class FirefoxExternalServices extends DefaultExternalServices {
|
|||
return new MozL10n(mozL10n);
|
||||
}
|
||||
|
||||
static get scripting() {
|
||||
return FirefoxScripting;
|
||||
}
|
||||
|
||||
static get supportsIntegratedFind() {
|
||||
const support = FirefoxCom.requestSync("supportsIntegratedFind");
|
||||
return shadow(this, "supportsIntegratedFind", support);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue