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

Stop bundling the ReadableStream polyfill in MOZCENTRAL builds (PR 10470 follow-up)

Based on the discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1521413, this patch simply removes the `ReadableStream` polyfill completely from MOZCENTRAL builds.

With this patch, the size of the `gulp mozcentral` build target is thus further reduced (building on PR 10470):

|       | `build/mozcentral`
|-------|-------------------
|master |   3 339 666
|patch  |   3 209 572
This commit is contained in:
Jonas Jenwald 2019-01-23 20:18:23 +01:00
parent d614cabfa0
commit 249b199ff1
5 changed files with 5 additions and 47 deletions

6
src/pdf.worker.js vendored
View file

@ -12,14 +12,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-restricted-globals, no-unused-vars */
/* eslint-disable no-unused-vars */
'use strict';
if (PDFJSDev.test('MOZCENTRAL') && typeof ReadableStream === 'undefined') {
importScripts('./streams_polyfill.js');
}
const pdfjsVersion = PDFJSDev.eval('BUNDLE_VERSION');
const pdfjsBuild = PDFJSDev.eval('BUNDLE_BUILD');

View file

@ -15,10 +15,10 @@
/* eslint-disable no-restricted-globals */
if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) {
// On the main-thread the `streams_polyfill.js` file is loaded using a
// <script> tag; see `web/viewer-snippet-firefox-extension.html`.
// On the worker-thread the `streams_polyfill.js` file is (conditionally)
// loaded using `importScripts`; see `src/pdf.worker.js`.
if (typeof ReadableStream === 'undefined') {
throw new Error('Please enable ReadableStream support by resetting the ' +
'"javascript.options.streams" preference to "true" in about:config.');
}
exports.ReadableStream = ReadableStream;
} else {
let isReadableStreamSupported = false;