1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 23:28:06 +02:00

Move the disableRange option from the global PDFJS object and into getDocument instead

This commit is contained in:
Jonas Jenwald 2018-02-17 22:22:10 +01:00
parent 69d7191034
commit b69abf1111
6 changed files with 19 additions and 16 deletions

View file

@ -195,10 +195,10 @@ let PDFViewerApplication = {
AppOptions.set('textLayerMode', value);
}),
preferences.get('disableRange').then(function resolved(value) {
if (PDFJS.disableRange === true) {
if (AppOptions.get('disableRange') === true) {
return;
}
PDFJS.disableRange = value;
AppOptions.set('disableRange', value);
}),
preferences.get('disableStream').then(function resolved(value) {
if (PDFJS.disableStream === true) {
@ -260,7 +260,7 @@ let PDFViewerApplication = {
waitOn.push(loadFakeWorker());
}
if ('disablerange' in hashParams) {
PDFJS.disableRange = (hashParams['disablerange'] === 'true');
AppOptions.set('disableRange', hashParams['disablerange'] === 'true');
}
if ('disablestream' in hashParams) {
PDFJS.disableStream = (hashParams['disablestream'] === 'true');

View file

@ -13,6 +13,7 @@
* limitations under the License.
*/
import { apiCompatibilityParams } from 'pdfjs-lib';
import { viewerCompatibilityParams } from './viewer_compatibility';
const OptionKind = {
@ -149,6 +150,11 @@ const defaultOptions = {
value: false,
kind: OptionKind.API,
},
disableRange: {
/** @type {boolean} */
value: apiCompatibilityParams.disableRange || false,
kind: OptionKind.API,
},
isEvalSupported: {
/** @type {boolean} */
value: true,