mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
JS -- Add a sandbox based on quickjs
* quickjs-eval.js has been generated using https://github.com/mozilla/pdf.js.quickjs/ * lazy load of sandbox code * Rewrite tests to use the sandbox * Add a task `watch-sandbox` which update bundle pdf.sandbox.js on change in the sandbox code
This commit is contained in:
parent
d3936ac9d2
commit
c7974e9996
15 changed files with 886 additions and 245 deletions
|
@ -22,7 +22,7 @@ import { ProxyHandler } from "./proxy.js";
|
|||
import { Util } from "./util.js";
|
||||
import { ZoomType } from "./constants.js";
|
||||
|
||||
function initSandbox({ data, extra, out, testMode = false }) {
|
||||
function initSandbox({ data, extra, out }) {
|
||||
const proxyHandler = new ProxyHandler(data.dispatchEventName);
|
||||
const { send, crackURL } = extra;
|
||||
const doc = new Doc({
|
||||
|
@ -58,14 +58,6 @@ function initSandbox({ data, extra, out, testMode = false }) {
|
|||
out[name] = aform[name].bind(aform);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || TESTING")) &&
|
||||
testMode
|
||||
) {
|
||||
out._app = app;
|
||||
}
|
||||
}
|
||||
|
||||
export { initSandbox };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue