@@ -2468,17 +2468,18 @@ class WorkerTransport {
24682468
24692469 this . canvasFactory = factory . canvasFactory ;
24702470 this . filterFactory = factory . filterFactory ;
2471- this . cMapReaderFactory = factory . cMapReaderFactory ;
2472- this . standardFontDataFactory = factory . standardFontDataFactory ;
2473- this . wasmFactory = factory . wasmFactory ;
2471+ if ( typeof PDFJSDev === "undefined" || ! PDFJSDev . test ( "MOZCENTRAL" ) ) {
2472+ this . cMapReaderFactory = factory . cMapReaderFactory ;
2473+ this . standardFontDataFactory = factory . standardFontDataFactory ;
2474+ this . wasmFactory = factory . wasmFactory ;
2475+ }
2476+ this . pagesMapper = pagesMapper ;
24742477
24752478 this . destroyed = false ;
24762479 this . destroyCapability = null ;
24772480
24782481 this . setupMessageHandler ( ) ;
24792482
2480- this . pagesMapper = pagesMapper ;
2481-
24822483 if ( typeof PDFJSDev === "undefined" || PDFJSDev . test ( "TESTING" ) ) {
24832484 // For testing purposes.
24842485 Object . defineProperty ( this , "getNetworkStreamName" , {
@@ -2925,22 +2926,21 @@ class WorkerTransport {
29252926 this . #onProgress( data ) ;
29262927 } ) ;
29272928
2928- messageHandler . on ( "FetchBinaryData" , async data => {
2929- if ( typeof PDFJSDev !== "undefined" && PDFJSDev . test ( "MOZCENTRAL" ) ) {
2930- throw new Error ( "Not implemented: FetchBinaryData" ) ;
2931- }
2932- if ( this . destroyed ) {
2933- throw new Error ( "Worker was destroyed." ) ;
2934- }
2935- const factory = this [ data . type ] ;
2929+ if ( typeof PDFJSDev === "undefined" || ! PDFJSDev . test ( "MOZCENTRAL" ) ) {
2930+ messageHandler . on ( "FetchBinaryData" , async data => {
2931+ if ( this . destroyed ) {
2932+ throw new Error ( "Worker was destroyed." ) ;
2933+ }
2934+ const factory = this [ data . type ] ;
29362935
2937- if ( ! factory ) {
2938- throw new Error (
2939- `${ data . type } not initialized, see the \`useWorkerFetch\` parameter.`
2940- ) ;
2941- }
2942- return factory . fetch ( data ) ;
2943- } ) ;
2936+ if ( ! factory ) {
2937+ throw new Error (
2938+ `${ data . type } not initialized, see the \`useWorkerFetch\` parameter.`
2939+ ) ;
2940+ }
2941+ return factory . fetch ( data ) ;
2942+ } ) ;
2943+ }
29442944 }
29452945
29462946 getData ( ) {
0 commit comments