UNPKG

pdfjs-dist

Version:

Generic build of Mozilla's PDF.js library.

1 lines • 17.6 kB
{"version":3,"file":"pdf.sandbox.mjs","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;SAAA;SACA;;;;;UCDA;UACA;UACA;UACA;UACA,yCAAyC,wCAAwC;UACjF;UACA;UACA,E;;;;;UCPA,wF;;;;;;ACmBO,MAAMA,kBAAkB,CAAC;EAI9BC,WAAWA,CAACC,GAAG,EAAE;IACf,IAAI,CAACA,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,UAAU,GAAG,IAAIC,GAAG,CAAC,CAAC;IAG3B,IAAI,CAACC,OAAO,GAAG,IAAI;EACrB;EAEAC,OAAOA,CAAA,EAAG;IACR,IAAI,CAACD,OAAO,GAAG,IAAI;IACnB,KAAK,MAAME,EAAE,IAAI,IAAI,CAACJ,UAAU,CAACK,MAAM,CAAC,CAAC,EAAE;MACzC,IAAI,CAACN,GAAG,CAACO,YAAY,CAACF,EAAE,CAAC;IAC3B;IACA,IAAI,CAACJ,UAAU,GAAG,IAAI;EACxB;EAKAO,oBAAoBA,CAACC,GAAG,EAAE;IACxB,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAKAC,sBAAsBA,CAACF,GAAG,EAAE;IAC1B,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAKAE,qBAAqBA,CAACC,YAAY,EAAE;IAClC,MAAM,IAAIH,KAAK,CAAC,iBAAiB,CAAC;EACpC;EAMAI,mBAAmBA,CAACC,IAAI,EAAEC,IAAI,EAAE;IAC9B,IAAI,CAAC,IAAI,CAACb,OAAO,EAAE;MACjB;IACF;IACA,IAAI;MACFa,IAAI,GAAG,IAAI,CAACR,oBAAoB,CAACQ,IAAI,CAAC;MACtC,IAAI,CAACb,OAAO,CAACY,IAAI,EAAEC,IAAI,CAAC;IAC1B,CAAC,CAAC,OAAOC,CAAC,EAAE;MACV,IAAI,CAACjB,GAAG,CAACkB,OAAO,CAACC,K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,WAAW,CAAC,CAAC;MAClB,MAAM,IAAI/D,KAAK,CAAC,sBAAsB,CAAC;IACzC;EACF;EAEAyC,aAAaA,CAACH,KAAK,EAAE;IACnB,IAAI,CAACW,OAAO,EAAE7C,mBAAmB,CAAC,eAAe,EAAEkC,KAAK,CAAC;EAC3D;EAEA0B,aAAaA,CAAA,EAAG;IACd,IAAI,CAACb,OAAO,EAAEU,KAAK,CAAC,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC;EAChD;EAEAE,WAAWA,CAAA,EAAG;IACZ,IAAI,IAAI,CAACZ,OAAO,KAAK,IAAI,EAAE;MACzB,IAAI,CAACF,OAAO,CAACvD,OAAO,CAAC,CAAC;MACtB,IAAI,CAACuD,OAAO,GAAG,IAAI;MACnB,IAAI,CAACE,OAAO,CAACU,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE,EAAE,CAAC;MAC3C,IAAI,CAACV,OAAO,GAAG,IAAI;IACrB;EACF;EAEAc,cAAcA,CAACX,IAAI,EAAEY,GAAG,EAAE;IAgBtB,MAAM,IAAIlE,KAAK,CAAC,iCAAiC,CAAC;EAEtD;AACF;AAEA,eAAemE,cAAcA,CAACC,OAAO,GAAG,cAAc,EAAE;EACtD,MAAM;IAAEC,OAAO,EAAEC;EAAa,CAAC,GAAG;EAAA;EAAA;EAChC,GAAGF,OAAO,iBAAiB,CAC5B;EACD,MAAMpB,MAAM,GAAG,MAAMsB,YAAY,CAAC,CAAC;EACnC,OAAO,IAAIvB,OAAO,CAACwB,MAAM,EAAEvB,MAAM,CAAC;AACpC;AAEAwB,UAAU,CAACC,YAAY,GAAG;EACxBN;AACF,CAAC","sources":["webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/webpack/runtime/define property getters","webpack://pdf.js/webpack/runtime/hasOwnProperty shorthand","webpack://pdf.js/./src/pdf.sandbox.external.js","webpack://pdf.js/./src/pdf.sandbox.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// In mozilla-central, this file is loaded as non-module script,\n// so it mustn't have any dependencies.\n\n// eslint-disable-next-line no-restricted-syntax\nexport class SandboxSupportBase {\n /**\n * @param {DOMWindow} - win\n */\n constructor(win) {\n this.win = win;\n this.timeoutIds = new Map();\n\n // Will be assigned after the sandbox is initialized\n this.commFun = null;\n }\n\n destroy() {\n this.commFun = null;\n for (const id of this.timeoutIds.values()) {\n this.win.clearTimeout(id);\n }\n this.timeoutIds = null;\n }\n\n /**\n * @param {Object} val - Export a value in the sandbox.\n */\n exportValueToSandbox(val) {\n throw new Error(\"Not implemented\");\n }\n\n /**\n * @param {Object} val - Import a value from the sandbox.\n */\n importValueFromSandbox(val) {\n throw new Error(\"Not implemented\");\n }\n\n /**\n * @param {String} errorMessage - Create an error in the sandbox.\n */\n createErrorForSandbox(errorMessage) {\n throw new Error(\"Not implemented\");\n }\n\n /**\n * @param {String} name - Name of the function to call in the sandbox\n * @param {Array<Object>} args - Arguments of the function.\n */\n callSandboxFunction(name, args) {\n if (!this.commFun) {\n return;\n }\n try {\n args = this.exportValueToSandbox(args);\n this.commFun(name, args);\n } catch (e) {\n this.win.console.error(e);\n }\n }\n\n createSandboxExternals() {\n // All the functions in externals object are called\n // from the sandbox.\n const externals = {\n setTimeout: (callbackId, nMilliseconds) => {\n if (\n typeof callbackId !== \"number\" ||\n typeof nMilliseconds !== \"number\"\n ) {\n return;\n }\n\n if (callbackId === 0) {\n // This callbackId corresponds to the one used for userActivation.\n // So here, we cancel the last userActivation.\n this.win.clearTimeout(this.timeoutIds.get(callbackId));\n }\n\n const id = this.win.setTimeout(() => {\n this.timeoutIds.delete(callbackId);\n this.callSandboxFunction(\"timeoutCb\", {\n callbackId,\n interval: false,\n });\n }, nMilliseconds);\n this.timeoutIds.set(callbackId, id);\n },\n clearTimeout: callbackId => {\n this.win.clearTimeout(this.timeoutIds.get(callbackId));\n this.timeoutIds.delete(callbackId);\n },\n setInterval: (callbackId, nMilliseconds) => {\n if (\n typeof callbackId !== \"number\" ||\n typeof nMilliseconds !== \"number\"\n ) {\n return;\n }\n const id = this.win.setInterval(() => {\n this.callSandboxFunction(\"timeoutCb\", {\n callbackId,\n interval: true,\n });\n }, nMilliseconds);\n this.timeoutIds.set(callbackId, id);\n },\n clearInterval: callbackId => {\n this.win.clearInterval(this.timeoutIds.get(callbackId));\n this.timeoutIds.delete(callbackId);\n },\n alert: cMsg => {\n if (typeof cMsg !== \"string\") {\n return;\n }\n this.win.alert(cMsg);\n },\n confirm: cMsg => {\n if (typeof cMsg !== \"string\") {\n return false;\n }\n return this.win.confirm(cMsg);\n },\n prompt: (cQuestion, cDefault) => {\n if (typeof cQuestion !== \"string\" || typeof cDefault !== \"string\") {\n return null;\n }\n return this.win.prompt(cQuestion, cDefault);\n },\n parseURL: cUrl => {\n const url = new this.win.URL(cUrl);\n const props = [\n \"hash\",\n \"host\",\n \"hostname\",\n \"href\",\n \"origin\",\n \"password\",\n \"pathname\",\n \"port\",\n \"protocol\",\n \"search\",\n \"searchParams\",\n \"username\",\n ];\n\n return Object.fromEntries(\n props.map(name => [name, url[name].toString()])\n );\n },\n send: data => {\n if (!data) {\n return;\n }\n const event = new this.win.CustomEvent(\"updatefromsandbox\", {\n detail: this.importValueFromSandbox(data),\n });\n this.win.dispatchEvent(event);\n },\n };\n Object.setPrototypeOf(externals, null);\n\n return (name, args) => {\n try {\n const result = externals[name](...args);\n return this.exportValueToSandbox(result);\n } catch (error) {\n throw this.createErrorForSandbox(error?.toString() ?? \"\");\n }\n };\n }\n}\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { SandboxSupportBase } from \"./pdf.sandbox.external.js\";\n\nclass SandboxSupport extends SandboxSupportBase {\n exportValueToSandbox(val) {\n // The communication with the Quickjs sandbox is based on strings\n // So we use JSON.stringfy to serialize\n return JSON.stringify(val);\n }\n\n importValueFromSandbox(val) {\n return val;\n }\n\n createErrorForSandbox(errorMessage) {\n return new Error(errorMessage);\n }\n}\n\nclass Sandbox {\n constructor(win, module) {\n this.support = new SandboxSupport(win, this);\n\n // The \"external\" functions created in pdf.sandbox.external.js\n // are finally used here:\n // https://github.com/mozilla/pdf.js.quickjs/blob/main/src/myjs.js\n // They're called from the sandbox only.\n module.externalCall = this.support.createSandboxExternals();\n\n this._module = module;\n\n // 0 to display error using console.error\n // else display error using window.alert\n this._alertOnError = 0;\n }\n\n create(data) {\n if (PDFJSDev.test(\"TESTING\")) {\n this._module.ccall(\"nukeSandbox\", null, []);\n }\n const code = [PDFJSDev.eval(\"PDF_SCRIPTING_JS_SOURCE\")];\n\n if (PDFJSDev.test(\"TESTING\")) {\n code.push(\n `globalThis.sendResultForTesting = callExternalFunction.bind(null, \"send\");`\n );\n } else {\n code.push(\"delete dump;\");\n }\n\n let success = false;\n let buf = 0;\n try {\n const sandboxData = JSON.stringify(data);\n // \"pdfjsScripting.initSandbox...\" MUST be the last line to be evaluated\n // since the returned value is used for the communication.\n code.push(`pdfjsScripting.initSandbox({ data: ${sandboxData} })`);\n buf = this._module.stringToNewUTF8(code.join(\"\\n\"));\n\n success = !!this._module.ccall(\n \"init\",\n \"number\",\n [\"number\", \"number\"],\n [buf, this._alertOnError]\n );\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(error);\n } finally {\n if (buf) {\n this._module.ccall(\"free\", \"number\", [\"number\"], [buf]);\n }\n }\n\n if (success) {\n this.support.commFun = this._module.cwrap(\"commFun\", null, [\n \"string\",\n \"string\",\n ]);\n } else {\n this.nukeSandbox();\n throw new Error(\"Cannot start sandbox\");\n }\n }\n\n dispatchEvent(event) {\n this.support?.callSandboxFunction(\"dispatchEvent\", event);\n }\n\n dumpMemoryUse() {\n this._module?.ccall(\"dumpMemoryUse\", null, []);\n }\n\n nukeSandbox() {\n if (this._module !== null) {\n this.support.destroy();\n this.support = null;\n this._module.ccall(\"nukeSandbox\", null, []);\n this._module = null;\n }\n }\n\n evalForTesting(code, key) {\n if (PDFJSDev.test(\"TESTING\")) {\n this._module.ccall(\n \"evalInSandbox\",\n null,\n [\"string\", \"int\"],\n [\n `try {\n sendResultForTesting([{ id: \"${key}\", result: ${code} }]);\n } catch (error) {\n sendResultForTesting([{ id: \"${key}\", result: error.message }]);\n }`,\n this._alertOnError,\n ]\n );\n } else {\n throw new Error(\"Not implemented: evalForTesting\");\n }\n }\n}\n\nasync function QuickJSSandbox(wasmUrl = \"../web/wasm/\") {\n const { default: ModuleLoader } = await __raw_import__(\n `${wasmUrl}quickjs-eval.js`\n );\n const module = await ModuleLoader();\n return new Sandbox(window, module);\n}\n\nglobalThis.pdfjsSandbox = {\n QuickJSSandbox,\n};\n\nexport { QuickJSSandbox };\n"],"names":["SandboxSupportBase","constructor","win","timeoutIds","Map","commFun","destroy","id","values","clearTimeout","exportValueToSandbox","val","Error","importValueFromSandbox","createErrorForSandbox","errorMessage","callSandboxFunction","name","args","e","console","error","createSandboxExternals","externals","setTimeout","callbackId","nMilliseconds","get","delete","interval","set","setInterval","clearInterval","alert","cMsg","confirm","prompt","cQuestion","cDefault","parseURL","cUrl","url","URL","props","Object","fromEntries","map","toString","send","data","event","CustomEvent","detail","dispatchEvent","setPrototypeOf","result","SandboxSupport","JSON","stringify","Sandbox","module","support","externalCall","_module","_alertOnError","create","code","push","success","buf","sandboxData","stringToNewUTF8","join","ccall","cwrap","nukeSandbox","dumpMemoryUse","evalForTesting","key","QuickJSSandbox","wasmUrl","default","ModuleLoader","window","globalThis","pdfjsSandbox"],"sourceRoot":""}