JS - Add the basic architecture to be able to execute embedded js

This commit is contained in:
Calixte Denizet 2020-10-01 13:57:23 +02:00
parent a373137304
commit e76a96892a
18 changed files with 823 additions and 0 deletions

View file

@ -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);