pdfjs-dist 2.1.266 → 2.2.228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pdfjs-dist might be problematic. Click here for more details.
- package/CODE_OF_CONDUCT.md +15 -0
- package/bower.json +1 -1
- package/build/pdf.js +3349 -2324
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +2804 -1975
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/image_decoders/pdf.image_decoders.js +431 -511
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +1 -1
- package/lib/core/annotation.js +294 -224
- package/lib/core/arithmetic_decoder.js +1 -1
- package/lib/core/bidi.js +1 -1
- package/lib/core/ccitt.js +1 -1
- package/lib/core/ccitt_stream.js +1 -1
- package/lib/core/cff_parser.js +61 -12
- package/lib/core/charsets.js +1 -1
- package/lib/core/chunked_stream.js +24 -14
- package/lib/core/cmap.js +17 -13
- package/lib/core/colorspace.js +1 -1
- package/lib/core/core_utils.js +147 -0
- package/lib/core/crypto.js +1 -1
- package/lib/core/document.js +47 -40
- package/lib/core/encodings.js +1 -1
- package/lib/core/evaluator.js +346 -279
- package/lib/core/font_renderer.js +1 -1
- package/lib/core/fonts.js +23 -11
- package/lib/core/function.js +1 -1
- package/lib/core/glyphlist.js +2 -2
- package/lib/core/image.js +2 -2
- package/lib/core/image_utils.js +111 -0
- package/lib/core/jbig2.js +1 -1
- package/lib/core/jbig2_stream.js +1 -1
- package/lib/core/jpeg_stream.js +1 -1
- package/lib/core/jpg.js +2 -1
- package/lib/core/jpx.js +1 -1
- package/lib/core/jpx_stream.js +1 -1
- package/lib/core/metrics.js +13 -13
- package/lib/core/murmurhash3.js +37 -33
- package/lib/core/obj.js +245 -41
- package/lib/core/operator_list.js +43 -32
- package/lib/core/parser.js +228 -133
- package/lib/core/pattern.js +4 -2
- package/lib/core/pdf_manager.js +17 -15
- package/lib/core/primitives.js +40 -6
- package/lib/core/ps_parser.js +1 -1
- package/lib/core/standard_fonts.js +9 -9
- package/lib/core/stream.js +1 -1
- package/lib/core/type1_parser.js +1 -1
- package/lib/core/unicode.js +2 -2
- package/lib/core/worker.js +54 -171
- package/lib/core/worker_stream.js +277 -0
- package/lib/display/annotation_layer.js +112 -33
- package/lib/display/api.js +211 -123
- package/lib/display/api_compatibility.js +1 -1
- package/lib/display/canvas.js +40 -19
- package/lib/display/content_disposition.js +1 -1
- package/lib/display/display_utils.js +747 -0
- package/lib/display/fetch_stream.js +19 -12
- package/lib/display/font_loader.js +11 -8
- package/lib/display/metadata.js +1 -1
- package/lib/display/network.js +563 -521
- package/lib/display/network_utils.js +1 -1
- package/lib/display/node_stream.js +21 -12
- package/lib/display/pattern_helper.js +24 -25
- package/lib/display/svg.js +1068 -565
- package/lib/display/text_layer.js +24 -14
- package/lib/display/transport_stream.js +192 -70
- package/lib/display/webgl.js +1 -1
- package/lib/display/worker_options.js +1 -1
- package/lib/display/xml_parser.js +1 -1
- package/lib/examples/node/domstubs.js +4 -1
- package/lib/pdf.js +20 -15
- package/lib/pdf.worker.js +3 -3
- package/lib/shared/compatibility.js +6 -6
- package/lib/shared/global_scope.js +1 -1
- package/lib/shared/is_node.js +2 -2
- package/lib/shared/message_handler.js +7 -7
- package/lib/shared/streams_polyfill.js +1 -1
- package/lib/shared/url_polyfill.js +1 -1
- package/lib/shared/util.js +13 -125
- package/lib/test/unit/annotation_spec.js +278 -93
- package/lib/test/unit/api_spec.js +198 -188
- package/lib/test/unit/bidi_spec.js +1 -1
- package/lib/test/unit/cff_parser_spec.js +15 -1
- package/lib/test/unit/clitests_helper.js +3 -3
- package/lib/test/unit/cmap_spec.js +20 -20
- package/lib/test/unit/colorspace_spec.js +17 -12
- package/lib/test/unit/core_utils_spec.js +191 -0
- package/lib/test/unit/crypto_spec.js +1 -1
- package/lib/test/unit/custom_spec.js +8 -8
- package/lib/test/unit/display_svg_spec.js +8 -8
- package/lib/test/unit/display_utils_spec.js +273 -0
- package/lib/test/unit/document_spec.js +7 -12
- package/lib/test/unit/encodings_spec.js +5 -5
- package/lib/test/unit/evaluator_spec.js +8 -10
- package/lib/test/unit/fetch_stream_spec.js +109 -0
- package/lib/test/unit/function_spec.js +1 -1
- package/lib/test/unit/jasmine-boot.js +4 -4
- package/lib/test/unit/message_handler_spec.js +1 -1
- package/lib/test/unit/metadata_spec.js +1 -1
- package/lib/test/unit/murmurhash3_spec.js +1 -1
- package/lib/test/unit/network_spec.js +5 -55
- package/lib/test/unit/network_utils_spec.js +51 -1
- package/lib/test/unit/node_stream_spec.js +8 -8
- package/lib/test/unit/parser_spec.js +150 -86
- package/lib/test/unit/pdf_find_controller_spec.js +1 -1
- package/lib/test/unit/pdf_find_utils_spec.js +1 -1
- package/lib/test/unit/pdf_history_spec.js +1 -1
- package/lib/test/unit/primitives_spec.js +30 -17
- package/lib/test/unit/stream_spec.js +1 -1
- package/lib/test/unit/test_utils.js +197 -43
- package/lib/test/unit/testreporter.js +1 -1
- package/lib/test/unit/type1_parser_spec.js +1 -1
- package/lib/test/unit/ui_utils_spec.js +20 -20
- package/lib/test/unit/unicode_spec.js +5 -5
- package/lib/test/unit/util_spec.js +1 -164
- package/lib/web/annotation_layer_builder.js +1 -1
- package/lib/web/app.js +104 -60
- package/lib/web/app_options.js +45 -37
- package/lib/web/base_viewer.js +7 -7
- package/lib/web/chromecom.js +8 -8
- package/lib/web/debugger.js +7 -7
- package/lib/web/download_manager.js +3 -2
- package/lib/web/firefox_print_service.js +4 -2
- package/lib/web/firefoxcom.js +50 -19
- package/lib/web/genericcom.js +8 -8
- package/lib/web/genericl10n.js +10 -10
- package/lib/web/grab_to_pan.js +3 -1
- package/lib/web/interfaces.js +13 -13
- package/lib/web/overlay_manager.js +10 -10
- package/lib/web/password_prompt.js +2 -2
- package/lib/web/pdf_attachment_viewer.js +1 -1
- package/lib/web/pdf_cursor_tools.js +1 -1
- package/lib/web/pdf_document_properties.js +188 -119
- package/lib/web/pdf_find_bar.js +1 -1
- package/lib/web/pdf_find_controller.js +3 -3
- package/lib/web/pdf_find_utils.js +1 -1
- package/lib/web/pdf_history.js +1 -1
- package/lib/web/pdf_link_service.js +2 -2
- package/lib/web/pdf_outline_viewer.js +53 -28
- package/lib/web/pdf_page_view.js +9 -18
- package/lib/web/pdf_presentation_mode.js +1 -1
- package/lib/web/pdf_print_service.js +5 -3
- package/lib/web/pdf_rendering_queue.js +4 -7
- package/lib/web/pdf_sidebar.js +24 -17
- package/lib/web/pdf_sidebar_resizer.js +1 -1
- package/lib/web/pdf_single_page_viewer.js +1 -1
- package/lib/web/pdf_thumbnail_view.js +2 -2
- package/lib/web/pdf_thumbnail_viewer.js +3 -3
- package/lib/web/pdf_viewer.component.js +3 -3
- package/lib/web/pdf_viewer.js +3 -3
- package/lib/web/preferences.js +30 -30
- package/lib/web/secondary_toolbar.js +1 -1
- package/lib/web/text_layer_builder.js +23 -45
- package/lib/web/toolbar.js +1 -1
- package/lib/web/ui_utils.js +14 -14
- package/lib/web/view_history.js +15 -15
- package/lib/web/viewer_compatibility.js +1 -1
- package/package.json +1 -1
- package/web/pdf_viewer.css +21 -10
- package/web/pdf_viewer.js +126 -194
- package/web/pdf_viewer.js.map +1 -1
- package/lib/display/dom_utils.js +0 -494
- package/lib/test/unit/dom_utils_spec.js +0 -89
package/lib/web/app_options.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -30,6 +30,8 @@ var _pdf = require("../pdf");
|
|
30
30
|
|
31
31
|
var _viewer_compatibility = require("./viewer_compatibility");
|
32
32
|
|
33
|
+
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
34
|
+
|
33
35
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
34
36
|
|
35
37
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
@@ -37,15 +39,16 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
37
39
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
38
40
|
|
39
41
|
var OptionKind = {
|
40
|
-
VIEWER:
|
41
|
-
API:
|
42
|
-
WORKER:
|
42
|
+
VIEWER: 0x02,
|
43
|
+
API: 0x04,
|
44
|
+
WORKER: 0x08,
|
45
|
+
PREFERENCE: 0x80
|
43
46
|
};
|
44
47
|
exports.OptionKind = OptionKind;
|
45
48
|
var defaultOptions = {
|
46
49
|
cursorToolOnLoad: {
|
47
50
|
value: 0,
|
48
|
-
kind: OptionKind.VIEWER
|
51
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
49
52
|
},
|
50
53
|
defaultUrl: {
|
51
54
|
value: 'compressed.tracemonkey-pldi-09.pdf',
|
@@ -53,7 +56,7 @@ var defaultOptions = {
|
|
53
56
|
},
|
54
57
|
defaultZoomValue: {
|
55
58
|
value: '',
|
56
|
-
kind: OptionKind.VIEWER
|
59
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
57
60
|
},
|
58
61
|
disableHistory: {
|
59
62
|
value: false,
|
@@ -61,19 +64,19 @@ var defaultOptions = {
|
|
61
64
|
},
|
62
65
|
disablePageLabels: {
|
63
66
|
value: false,
|
64
|
-
kind: OptionKind.VIEWER
|
67
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
65
68
|
},
|
66
69
|
enablePrintAutoRotate: {
|
67
70
|
value: false,
|
68
|
-
kind: OptionKind.VIEWER
|
71
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
69
72
|
},
|
70
73
|
enableWebGL: {
|
71
74
|
value: false,
|
72
|
-
kind: OptionKind.VIEWER
|
75
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
73
76
|
},
|
74
77
|
eventBusDispatchToDOM: {
|
75
78
|
value: false,
|
76
|
-
kind: OptionKind.VIEWER
|
79
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
77
80
|
},
|
78
81
|
externalLinkRel: {
|
79
82
|
value: 'noopener noreferrer nofollow',
|
@@ -81,11 +84,11 @@ var defaultOptions = {
|
|
81
84
|
},
|
82
85
|
externalLinkTarget: {
|
83
86
|
value: 0,
|
84
|
-
kind: OptionKind.VIEWER
|
87
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
85
88
|
},
|
86
89
|
historyUpdateUrl: {
|
87
90
|
value: false,
|
88
|
-
kind: OptionKind.VIEWER
|
91
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
89
92
|
},
|
90
93
|
imageResourcesPath: {
|
91
94
|
value: './images/',
|
@@ -98,39 +101,39 @@ var defaultOptions = {
|
|
98
101
|
},
|
99
102
|
pdfBugEnabled: {
|
100
103
|
value: false,
|
101
|
-
kind: OptionKind.VIEWER
|
104
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
102
105
|
},
|
103
106
|
renderer: {
|
104
107
|
value: 'canvas',
|
105
|
-
kind: OptionKind.VIEWER
|
108
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
106
109
|
},
|
107
110
|
renderInteractiveForms: {
|
108
111
|
value: false,
|
109
|
-
kind: OptionKind.VIEWER
|
112
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
110
113
|
},
|
111
114
|
sidebarViewOnLoad: {
|
112
115
|
value: -1,
|
113
|
-
kind: OptionKind.VIEWER
|
116
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
114
117
|
},
|
115
118
|
scrollModeOnLoad: {
|
116
119
|
value: -1,
|
117
|
-
kind: OptionKind.VIEWER
|
120
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
118
121
|
},
|
119
122
|
spreadModeOnLoad: {
|
120
123
|
value: -1,
|
121
|
-
kind: OptionKind.VIEWER
|
124
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
122
125
|
},
|
123
126
|
textLayerMode: {
|
124
127
|
value: 1,
|
125
|
-
kind: OptionKind.VIEWER
|
128
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
126
129
|
},
|
127
130
|
useOnlyCssZoom: {
|
128
131
|
value: false,
|
129
|
-
kind: OptionKind.VIEWER
|
132
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
130
133
|
},
|
131
134
|
viewOnLoad: {
|
132
135
|
value: 0,
|
133
|
-
kind: OptionKind.VIEWER
|
136
|
+
kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
134
137
|
},
|
135
138
|
cMapPacked: {
|
136
139
|
value: true,
|
@@ -142,7 +145,7 @@ var defaultOptions = {
|
|
142
145
|
},
|
143
146
|
disableAutoFetch: {
|
144
147
|
value: false,
|
145
|
-
kind: OptionKind.API
|
148
|
+
kind: OptionKind.API + OptionKind.PREFERENCE
|
146
149
|
},
|
147
150
|
disableCreateObjectURL: {
|
148
151
|
value: false,
|
@@ -151,15 +154,15 @@ var defaultOptions = {
|
|
151
154
|
},
|
152
155
|
disableFontFace: {
|
153
156
|
value: false,
|
154
|
-
kind: OptionKind.API
|
157
|
+
kind: OptionKind.API + OptionKind.PREFERENCE
|
155
158
|
},
|
156
159
|
disableRange: {
|
157
160
|
value: false,
|
158
|
-
kind: OptionKind.API
|
161
|
+
kind: OptionKind.API + OptionKind.PREFERENCE
|
159
162
|
},
|
160
163
|
disableStream: {
|
161
164
|
value: false,
|
162
|
-
kind: OptionKind.API
|
165
|
+
kind: OptionKind.API + OptionKind.PREFERENCE
|
163
166
|
},
|
164
167
|
isEvalSupported: {
|
165
168
|
value: true,
|
@@ -190,16 +193,7 @@ var defaultOptions = {
|
|
190
193
|
kind: OptionKind.WORKER
|
191
194
|
}
|
192
195
|
};
|
193
|
-
|
194
|
-
defaultOptions.disablePreferences = {
|
195
|
-
value: false,
|
196
|
-
kind: OptionKind.VIEWER
|
197
|
-
};
|
198
|
-
defaultOptions.locale = {
|
199
|
-
value: typeof navigator !== 'undefined' ? navigator.language : 'en-US',
|
200
|
-
kind: OptionKind.VIEWER
|
201
|
-
};
|
202
|
-
}
|
196
|
+
;
|
203
197
|
var userOptions = Object.create(null);
|
204
198
|
|
205
199
|
var AppOptions =
|
@@ -237,8 +231,22 @@ function () {
|
|
237
231
|
for (var name in defaultOptions) {
|
238
232
|
var defaultOption = defaultOptions[name];
|
239
233
|
|
240
|
-
if (kind
|
241
|
-
|
234
|
+
if (kind) {
|
235
|
+
if ((kind & defaultOption.kind) === 0) {
|
236
|
+
continue;
|
237
|
+
}
|
238
|
+
|
239
|
+
if (kind === OptionKind.PREFERENCE) {
|
240
|
+
var value = defaultOption.value,
|
241
|
+
valueType = _typeof(value);
|
242
|
+
|
243
|
+
if (valueType === 'boolean' || valueType === 'string' || valueType === 'number' && Number.isInteger(value)) {
|
244
|
+
options[name] = value;
|
245
|
+
continue;
|
246
|
+
}
|
247
|
+
|
248
|
+
throw new Error("Invalid type for preference: ".concat(name));
|
249
|
+
}
|
242
250
|
}
|
243
251
|
|
244
252
|
var userOption = userOptions[name];
|
package/lib/web/base_viewer.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -277,6 +277,10 @@ function () {
|
|
277
277
|
}
|
278
278
|
|
279
279
|
onePageRenderedCapability.promise.then(function () {
|
280
|
+
if (_this2.findController) {
|
281
|
+
_this2.findController.setDocument(pdfDocument);
|
282
|
+
}
|
283
|
+
|
280
284
|
if (pdfDocument.loadingParams['disableAutoFetch']) {
|
281
285
|
pagesCapability.resolve();
|
282
286
|
return;
|
@@ -315,14 +319,10 @@ function () {
|
|
315
319
|
source: _this2
|
316
320
|
});
|
317
321
|
|
318
|
-
if (_this2.findController) {
|
319
|
-
_this2.findController.setDocument(pdfDocument);
|
320
|
-
}
|
321
|
-
|
322
322
|
if (_this2.defaultRenderingQueue) {
|
323
323
|
_this2.update();
|
324
324
|
}
|
325
|
-
})
|
325
|
+
})["catch"](function (reason) {
|
326
326
|
console.error('Unable to initialize viewer', reason);
|
327
327
|
});
|
328
328
|
}
|
@@ -781,7 +781,7 @@ function () {
|
|
781
781
|
|
782
782
|
_this3._pagesRequests[pageNumber] = null;
|
783
783
|
return pdfPage;
|
784
|
-
})
|
784
|
+
})["catch"](function (reason) {
|
785
785
|
console.error('Unable to get page for page view', reason);
|
786
786
|
_this3._pagesRequests[pageNumber] = null;
|
787
787
|
});
|
package/lib/web/chromecom.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -40,7 +40,7 @@ var _genericl10n = require("./genericl10n");
|
|
40
40
|
|
41
41
|
var _pdf = require("../pdf");
|
42
42
|
|
43
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
43
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
44
44
|
|
45
45
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
46
46
|
|
@@ -338,10 +338,10 @@ function (_BasePreferences) {
|
|
338
338
|
value: function () {
|
339
339
|
var _writeToStorage2 = _asyncToGenerator(
|
340
340
|
/*#__PURE__*/
|
341
|
-
_regenerator
|
341
|
+
_regenerator["default"].mark(function _callee(prefObj) {
|
342
342
|
var _this = this;
|
343
343
|
|
344
|
-
return _regenerator
|
344
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
345
345
|
while (1) {
|
346
346
|
switch (_context.prev = _context.next) {
|
347
347
|
case 0:
|
@@ -363,7 +363,7 @@ function (_BasePreferences) {
|
|
363
363
|
return _context.stop();
|
364
364
|
}
|
365
365
|
}
|
366
|
-
}, _callee
|
366
|
+
}, _callee);
|
367
367
|
}));
|
368
368
|
|
369
369
|
function _writeToStorage(_x) {
|
@@ -377,10 +377,10 @@ function (_BasePreferences) {
|
|
377
377
|
value: function () {
|
378
378
|
var _readFromStorage2 = _asyncToGenerator(
|
379
379
|
/*#__PURE__*/
|
380
|
-
_regenerator
|
380
|
+
_regenerator["default"].mark(function _callee2(prefObj) {
|
381
381
|
var _this2 = this;
|
382
382
|
|
383
|
-
return _regenerator
|
383
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
384
384
|
while (1) {
|
385
385
|
switch (_context2.prev = _context2.next) {
|
386
386
|
case 0:
|
@@ -441,7 +441,7 @@ function (_BasePreferences) {
|
|
441
441
|
return _context2.stop();
|
442
442
|
}
|
443
443
|
}
|
444
|
-
}, _callee2
|
444
|
+
}, _callee2);
|
445
445
|
}));
|
446
446
|
|
447
447
|
function _readFromStorage(_x2) {
|
package/lib/web/debugger.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -44,8 +44,8 @@ var FontInspector = function FontInspectorClosure() {
|
|
44
44
|
_iteratorError = err;
|
45
45
|
} finally {
|
46
46
|
try {
|
47
|
-
if (!_iteratorNormalCompletion && _iterator
|
48
|
-
_iterator
|
47
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
48
|
+
_iterator["return"]();
|
49
49
|
}
|
50
50
|
} finally {
|
51
51
|
if (_didIteratorError) {
|
@@ -71,8 +71,8 @@ var FontInspector = function FontInspectorClosure() {
|
|
71
71
|
_iteratorError2 = err;
|
72
72
|
} finally {
|
73
73
|
try {
|
74
|
-
if (!_iteratorNormalCompletion2 && _iterator2
|
75
|
-
_iterator2
|
74
|
+
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
|
75
|
+
_iterator2["return"]();
|
76
76
|
}
|
77
77
|
} finally {
|
78
78
|
if (_didIteratorError2) {
|
@@ -98,8 +98,8 @@ var FontInspector = function FontInspectorClosure() {
|
|
98
98
|
_iteratorError3 = err;
|
99
99
|
} finally {
|
100
100
|
try {
|
101
|
-
if (!_iteratorNormalCompletion3 && _iterator3
|
102
|
-
_iterator3
|
101
|
+
if (!_iteratorNormalCompletion3 && _iterator3["return"] != null) {
|
102
|
+
_iterator3["return"]();
|
103
103
|
}
|
104
104
|
} finally {
|
105
105
|
if (_didIteratorError3) {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -81,9 +81,10 @@ function () {
|
|
81
81
|
key: "downloadData",
|
82
82
|
value: function downloadData(data, filename, contentType) {
|
83
83
|
if (navigator.msSaveBlob) {
|
84
|
-
|
84
|
+
navigator.msSaveBlob(new Blob([data], {
|
85
85
|
type: contentType
|
86
86
|
}), filename);
|
87
|
+
return;
|
87
88
|
}
|
88
89
|
|
89
90
|
var blobUrl = (0, _pdf.createObjectURL)(data, contentType, this.disableCreateObjectURL);
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -26,6 +26,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
26
26
|
});
|
27
27
|
exports.FirefoxPrintService = FirefoxPrintService;
|
28
28
|
|
29
|
+
var _app_options = require("./app_options");
|
30
|
+
|
29
31
|
var _ui_utils = require("./ui_utils");
|
30
32
|
|
31
33
|
var _app = require("./app");
|
@@ -34,7 +36,7 @@ var _pdf = require("../pdf");
|
|
34
36
|
|
35
37
|
function composePage(pdfDocument, pageNumber, size, printContainer) {
|
36
38
|
var canvas = document.createElement('canvas');
|
37
|
-
var PRINT_RESOLUTION = 150;
|
39
|
+
var PRINT_RESOLUTION = _app_options.AppOptions.get('printResolution') || 150;
|
38
40
|
var PRINT_UNITS = PRINT_RESOLUTION / 72.0;
|
39
41
|
canvas.width = Math.floor(size.width * PRINT_UNITS);
|
40
42
|
canvas.height = Math.floor(size.height * PRINT_UNITS);
|
package/lib/web/firefoxcom.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -36,7 +36,7 @@ var _preferences = require("./preferences");
|
|
36
36
|
|
37
37
|
var _app = require("./app");
|
38
38
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
40
40
|
|
41
41
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
42
42
|
|
@@ -180,8 +180,8 @@ function (_BasePreferences) {
|
|
180
180
|
value: function () {
|
181
181
|
var _writeToStorage2 = _asyncToGenerator(
|
182
182
|
/*#__PURE__*/
|
183
|
-
_regenerator
|
184
|
-
return _regenerator
|
183
|
+
_regenerator["default"].mark(function _callee(prefObj) {
|
184
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
185
185
|
while (1) {
|
186
186
|
switch (_context.prev = _context.next) {
|
187
187
|
case 0:
|
@@ -194,7 +194,7 @@ function (_BasePreferences) {
|
|
194
194
|
return _context.stop();
|
195
195
|
}
|
196
196
|
}
|
197
|
-
}, _callee
|
197
|
+
}, _callee);
|
198
198
|
}));
|
199
199
|
|
200
200
|
function _writeToStorage(_x) {
|
@@ -208,8 +208,8 @@ function (_BasePreferences) {
|
|
208
208
|
value: function () {
|
209
209
|
var _readFromStorage2 = _asyncToGenerator(
|
210
210
|
/*#__PURE__*/
|
211
|
-
_regenerator
|
212
|
-
return _regenerator
|
211
|
+
_regenerator["default"].mark(function _callee2(prefObj) {
|
212
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
213
213
|
while (1) {
|
214
214
|
switch (_context2.prev = _context2.next) {
|
215
215
|
case 0:
|
@@ -225,7 +225,7 @@ function (_BasePreferences) {
|
|
225
225
|
return _context2.stop();
|
226
226
|
}
|
227
227
|
}
|
228
|
-
}, _callee2
|
228
|
+
}, _callee2);
|
229
229
|
}));
|
230
230
|
|
231
231
|
function _readFromStorage(_x2) {
|
@@ -253,8 +253,8 @@ function () {
|
|
253
253
|
value: function () {
|
254
254
|
var _getLanguage = _asyncToGenerator(
|
255
255
|
/*#__PURE__*/
|
256
|
-
_regenerator
|
257
|
-
return _regenerator
|
256
|
+
_regenerator["default"].mark(function _callee3() {
|
257
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
258
258
|
while (1) {
|
259
259
|
switch (_context3.prev = _context3.next) {
|
260
260
|
case 0:
|
@@ -279,8 +279,8 @@ function () {
|
|
279
279
|
value: function () {
|
280
280
|
var _getDirection = _asyncToGenerator(
|
281
281
|
/*#__PURE__*/
|
282
|
-
_regenerator
|
283
|
-
return _regenerator
|
282
|
+
_regenerator["default"].mark(function _callee4() {
|
283
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
284
284
|
while (1) {
|
285
285
|
switch (_context4.prev = _context4.next) {
|
286
286
|
case 0:
|
@@ -305,8 +305,8 @@ function () {
|
|
305
305
|
value: function () {
|
306
306
|
var _get = _asyncToGenerator(
|
307
307
|
/*#__PURE__*/
|
308
|
-
_regenerator
|
309
|
-
return _regenerator
|
308
|
+
_regenerator["default"].mark(function _callee5(property, args, fallback) {
|
309
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
310
310
|
while (1) {
|
311
311
|
switch (_context5.prev = _context5.next) {
|
312
312
|
case 0:
|
@@ -331,8 +331,8 @@ function () {
|
|
331
331
|
value: function () {
|
332
332
|
var _translate = _asyncToGenerator(
|
333
333
|
/*#__PURE__*/
|
334
|
-
_regenerator
|
335
|
-
return _regenerator
|
334
|
+
_regenerator["default"].mark(function _callee6(element) {
|
335
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
336
336
|
while (1) {
|
337
337
|
switch (_context6.prev = _context6.next) {
|
338
338
|
case 0:
|
@@ -388,8 +388,31 @@ function () {
|
|
388
388
|
});
|
389
389
|
};
|
390
390
|
|
391
|
-
for (var _i = 0; _i <
|
392
|
-
var event =
|
391
|
+
for (var _i = 0, _events = events; _i < _events.length; _i++) {
|
392
|
+
var event = _events[_i];
|
393
|
+
window.addEventListener(event, handleEvent);
|
394
|
+
}
|
395
|
+
})();
|
396
|
+
|
397
|
+
(function listenZoomEvents() {
|
398
|
+
var events = ['zoomin', 'zoomout', 'zoomreset'];
|
399
|
+
|
400
|
+
var handleEvent = function handleEvent(_ref2) {
|
401
|
+
var type = _ref2.type,
|
402
|
+
detail = _ref2.detail;
|
403
|
+
|
404
|
+
if (!_app.PDFViewerApplication.initialized) {
|
405
|
+
return;
|
406
|
+
}
|
407
|
+
|
408
|
+
_app.PDFViewerApplication.eventBus.dispatch(type, {
|
409
|
+
source: window,
|
410
|
+
ignoreDuplicate: type === 'zoomreset' ? true : undefined
|
411
|
+
});
|
412
|
+
};
|
413
|
+
|
414
|
+
for (var _i2 = 0, _events2 = events; _i2 < _events2.length; _i2++) {
|
415
|
+
var event = _events2[_i2];
|
393
416
|
window.addEventListener(event, handleEvent);
|
394
417
|
}
|
395
418
|
})();
|
@@ -446,7 +469,7 @@ _app.PDFViewerApplication.externalServices = {
|
|
446
469
|
|
447
470
|
switch (args.pdfjsLoadAction) {
|
448
471
|
case 'supportsRangedLoading':
|
449
|
-
pdfDataRangeTransport = new FirefoxComDataRangeTransport(args.length, args.data);
|
472
|
+
pdfDataRangeTransport = new FirefoxComDataRangeTransport(args.length, args.data, args.done);
|
450
473
|
callbacks.onOpenWithTransport(args.pdfUrl, args.length, pdfDataRangeTransport);
|
451
474
|
break;
|
452
475
|
|
@@ -460,6 +483,14 @@ _app.PDFViewerApplication.externalServices = {
|
|
460
483
|
|
461
484
|
case 'progressiveRead':
|
462
485
|
pdfDataRangeTransport.onDataProgressiveRead(args.chunk);
|
486
|
+
pdfDataRangeTransport.onDataProgress(args.loaded, args.total);
|
487
|
+
break;
|
488
|
+
|
489
|
+
case 'progressiveDone':
|
490
|
+
if (pdfDataRangeTransport) {
|
491
|
+
pdfDataRangeTransport.onDataProgressiveDone();
|
492
|
+
}
|
493
|
+
|
463
494
|
break;
|
464
495
|
|
465
496
|
case 'progress':
|
package/lib/web/genericcom.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -36,7 +36,7 @@ var _download_manager = require("./download_manager");
|
|
36
36
|
|
37
37
|
var _genericl10n = require("./genericl10n");
|
38
38
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
40
40
|
|
41
41
|
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
42
42
|
|
@@ -80,8 +80,8 @@ function (_BasePreferences) {
|
|
80
80
|
value: function () {
|
81
81
|
var _writeToStorage2 = _asyncToGenerator(
|
82
82
|
/*#__PURE__*/
|
83
|
-
_regenerator
|
84
|
-
return _regenerator
|
83
|
+
_regenerator["default"].mark(function _callee(prefObj) {
|
84
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
85
85
|
while (1) {
|
86
86
|
switch (_context.prev = _context.next) {
|
87
87
|
case 0:
|
@@ -92,7 +92,7 @@ function (_BasePreferences) {
|
|
92
92
|
return _context.stop();
|
93
93
|
}
|
94
94
|
}
|
95
|
-
}, _callee
|
95
|
+
}, _callee);
|
96
96
|
}));
|
97
97
|
|
98
98
|
function _writeToStorage(_x) {
|
@@ -106,8 +106,8 @@ function (_BasePreferences) {
|
|
106
106
|
value: function () {
|
107
107
|
var _readFromStorage2 = _asyncToGenerator(
|
108
108
|
/*#__PURE__*/
|
109
|
-
_regenerator
|
110
|
-
return _regenerator
|
109
|
+
_regenerator["default"].mark(function _callee2(prefObj) {
|
110
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
111
111
|
while (1) {
|
112
112
|
switch (_context2.prev = _context2.next) {
|
113
113
|
case 0:
|
@@ -118,7 +118,7 @@ function (_BasePreferences) {
|
|
118
118
|
return _context2.stop();
|
119
119
|
}
|
120
120
|
}
|
121
|
-
}, _callee2
|
121
|
+
}, _callee2);
|
122
122
|
}));
|
123
123
|
|
124
124
|
function _readFromStorage(_x2) {
|
package/lib/web/genericl10n.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -30,7 +30,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
30
30
|
|
31
31
|
require("../external/webL10n/l10n");
|
32
32
|
|
33
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
33
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
34
34
|
|
35
35
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
36
36
|
|
@@ -63,9 +63,9 @@ function () {
|
|
63
63
|
value: function () {
|
64
64
|
var _getLanguage = _asyncToGenerator(
|
65
65
|
/*#__PURE__*/
|
66
|
-
_regenerator
|
66
|
+
_regenerator["default"].mark(function _callee() {
|
67
67
|
var l10n;
|
68
|
-
return _regenerator
|
68
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
69
69
|
while (1) {
|
70
70
|
switch (_context.prev = _context.next) {
|
71
71
|
case 0:
|
@@ -95,9 +95,9 @@ function () {
|
|
95
95
|
value: function () {
|
96
96
|
var _getDirection = _asyncToGenerator(
|
97
97
|
/*#__PURE__*/
|
98
|
-
_regenerator
|
98
|
+
_regenerator["default"].mark(function _callee2() {
|
99
99
|
var l10n;
|
100
|
-
return _regenerator
|
100
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
101
101
|
while (1) {
|
102
102
|
switch (_context2.prev = _context2.next) {
|
103
103
|
case 0:
|
@@ -127,9 +127,9 @@ function () {
|
|
127
127
|
value: function () {
|
128
128
|
var _get = _asyncToGenerator(
|
129
129
|
/*#__PURE__*/
|
130
|
-
_regenerator
|
130
|
+
_regenerator["default"].mark(function _callee3(property, args, fallback) {
|
131
131
|
var l10n;
|
132
|
-
return _regenerator
|
132
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
133
133
|
while (1) {
|
134
134
|
switch (_context3.prev = _context3.next) {
|
135
135
|
case 0:
|
@@ -159,9 +159,9 @@ function () {
|
|
159
159
|
value: function () {
|
160
160
|
var _translate = _asyncToGenerator(
|
161
161
|
/*#__PURE__*/
|
162
|
-
_regenerator
|
162
|
+
_regenerator["default"].mark(function _callee4(element) {
|
163
163
|
var l10n;
|
164
|
-
return _regenerator
|
164
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
165
165
|
while (1) {
|
166
166
|
switch (_context4.prev = _context4.next) {
|
167
167
|
case 0:
|