mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
[api-minor] Remove the disableCreateObjectURL
option from the getDocument
parameters, since it's now unused in the API
With the changes in previous patches, the `disableCreateObjectURL` option/functionality is no longer used for anything in the API and/or in the Worker code. Note however that there's some functionality, mainly related to file loading/downloading, in the GENERIC version of the default viewer which still depends on this option. Hence the `disableCreateObjectURL` option (and related compatibility code) is moved into the viewer, see e.g. `web/app_options.js`, such that it's still available in the default viewer.
This commit is contained in:
parent
cc4cc8b11b
commit
18e0b10d3c
11 changed files with 25 additions and 48 deletions
|
@ -85,7 +85,6 @@ import { PDFImage } from "./image.js";
|
|||
|
||||
var PartialEvaluator = (function PartialEvaluatorClosure() {
|
||||
const DefaultPartialEvaluatorOptions = {
|
||||
forceDataSchema: false,
|
||||
maxImageSize: -1,
|
||||
disableFontFace: false,
|
||||
ignoreErrors: false,
|
||||
|
|
|
@ -399,7 +399,6 @@ var WorkerMessageHandler = {
|
|||
ensureNotTerminated();
|
||||
|
||||
var evaluatorOptions = {
|
||||
forceDataSchema: data.disableCreateObjectURL,
|
||||
maxImageSize: data.maxImageSize,
|
||||
disableFontFace: data.disableFontFace,
|
||||
ignoreErrors: data.ignoreErrors,
|
||||
|
|
|
@ -154,9 +154,6 @@ function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {
|
|||
* The default value is `false`.
|
||||
* NOTE: It is also necessary to disable streaming, see above,
|
||||
* in order for disabling of pre-fetching to work correctly.
|
||||
* @property {boolean} [disableCreateObjectURL] - Disable the use of
|
||||
* `URL.createObjectURL`, for compatibility with older browsers.
|
||||
* The default value is `false`.
|
||||
* @property {boolean} [pdfBug] - Enables special hooks for debugging
|
||||
* PDF.js (see `web/debugger.js`). The default value is `false`.
|
||||
*/
|
||||
|
@ -269,10 +266,6 @@ function getDocument(src) {
|
|||
if (typeof params.disableAutoFetch !== "boolean") {
|
||||
params.disableAutoFetch = false;
|
||||
}
|
||||
if (typeof params.disableCreateObjectURL !== "boolean") {
|
||||
params.disableCreateObjectURL =
|
||||
apiCompatibilityParams.disableCreateObjectURL || false;
|
||||
}
|
||||
|
||||
// Set the main-thread verbosity level.
|
||||
setVerbosityLevel(params.verbosity);
|
||||
|
@ -395,7 +388,6 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
|
|||
},
|
||||
maxImageSize: source.maxImageSize,
|
||||
disableFontFace: source.disableFontFace,
|
||||
disableCreateObjectURL: source.disableCreateObjectURL,
|
||||
postMessageTransfers: worker.postMessageTransfers,
|
||||
docBaseUrl: source.docBaseUrl,
|
||||
ignoreErrors: source.ignoreErrors,
|
||||
|
@ -2505,7 +2497,6 @@ class WorkerTransport {
|
|||
const params = this._params;
|
||||
return shadow(this, "loadingParams", {
|
||||
disableAutoFetch: params.disableAutoFetch,
|
||||
disableCreateObjectURL: params.disableCreateObjectURL,
|
||||
disableFontFace: params.disableFontFace,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -17,21 +17,6 @@ import { isNodeJS } from "../shared/is_node.js";
|
|||
|
||||
const compatibilityParams = Object.create(null);
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||
const userAgent =
|
||||
(typeof navigator !== "undefined" && navigator.userAgent) || "";
|
||||
const isIE = /Trident/.test(userAgent);
|
||||
const isIOSChrome = /CriOS/.test(userAgent);
|
||||
|
||||
// Checks if possible to use URL.createObjectURL()
|
||||
// Support: IE, Chrome on iOS
|
||||
(function checkOnBlobSupport() {
|
||||
// Sometimes IE and Chrome on iOS losing the data created with
|
||||
// createObjectURL(), see issues #3977 and #8081.
|
||||
if (isIE || isIOSChrome) {
|
||||
compatibilityParams.disableCreateObjectURL = true;
|
||||
}
|
||||
})();
|
||||
|
||||
// Support: Node.js
|
||||
(function checkFontFace() {
|
||||
// Node.js is missing native support for `@font-face`.
|
||||
|
|
|
@ -440,7 +440,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||
|
||||
// eslint-disable-next-line no-shadow
|
||||
SVGGraphics = class SVGGraphics {
|
||||
constructor(commonObjs, objs, forceDataSchema) {
|
||||
constructor(commonObjs, objs, forceDataSchema = false) {
|
||||
this.svgFactory = new DOMSVGFactory();
|
||||
|
||||
this.current = new SVGExtraState();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue