{"record":{"id":"c6004fc25a39ce01","repo":"mozilla/pdf.js","slug":"not-implemented-getoperatorlist","errorCode":null,"errorMessage":"Not implemented: getOperatorList","messagePattern":"Not implemented: getOperatorList","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/display/api.js","lineNumber":1692,"sourceCode":"      .catch(complete);\n\n    return renderTask;\n  }\n\n  /**\n   * @param {GetOperatorListParameters} params - Page getOperatorList\n   *   parameters.\n   * @returns {Promise<PDFOperatorList>} A promise resolved with an\n   *   {@link PDFOperatorList} object that represents the page's operator list.\n   */\n  getOperatorList({\n    intent = \"display\",\n    annotationMode = AnnotationMode.ENABLE,\n    printAnnotationStorage = null,\n    isEditing = false,\n  } = {}) {\n    if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n      throw new Error(\"Not implemented: getOperatorList\");\n    }\n    function operatorListChanged() {\n      if (intentState.operatorList.lastChunk) {\n        intentState.opListReadCapability.resolve(intentState.operatorList);\n\n        intentState.renderTasks.delete(opListTask);\n      }\n    }\n\n    const intentArgs = this._transport.getRenderingIntent(\n      intent,\n      annotationMode,\n      printAnnotationStorage,\n      isEditing,\n      /* isOpList = */ true\n    );\n    const intentState = this._intentStates.getOrInsertComputed(\n      intentArgs.cacheKey,","sourceCodeStart":1674,"sourceCodeEnd":1710,"githubUrl":"https://github.com/mozilla/pdf.js/blob/5903d58d58e4dd9ce6ffa3834aea8480f06b4ada/src/display/api.js#L1674-L1710","documentation":"A generic Error from PDFPageProxy.getOperatorList: the method is only available in the GENERIC build. The guard throws when PDFJSDev is defined and the build is not GENERIC (e.g. MOZCENTRAL or CHROME). getOperatorList exposes the raw display-List for debugging/tooling and is intentionally omitted from shipped browser builds.","triggerScenarios":"Calling page.getOperatorList() in a MOZCENTRAL or CHROME build; running third-party code that assumes the GENERIC API surface against a non-generic bundle; tooling built against pdfjs-dist but loaded in Firefox's built-in viewer.","commonSituations":"Using the Firefox-bundled pdf.js for an extension that needs operator-list access; mismatched build vs. API expectations; tests run against the wrong target.","solutions":["Use the GENERIC build (npm pdfjs-dist) where getOperatorList is available.","Feature-detect before calling: if (typeof page.getOperatorList === 'function').","Rebuild with the generic target (npx gulp generic)."],"exampleFix":"// before\nconst opList = await page.getOperatorList(); // throws in MOZCENTRAL\n\n// after\nif (typeof page.getOperatorList === 'function') {\n  const opList = await page.getOperatorList();\n} else {\n  // build does not support operator-list export; use GENERIC build\n}","handlingStrategy":"type-guard","validationCode":"if (typeof page.getOperatorList !== 'function') {\n  throw new Error('getOperatorList unavailable: use the GENERIC build');\n}","typeGuard":"function supportsOperatorList(page) {\n  return typeof page.getOperatorList === 'function';\n}","tryCatchPattern":null,"preventionTips":["Use the GENERIC (pdfjs-dist) build when you need getOperatorList.","Feature-detect before calling build-gated APIs.","Keep worker and API builds from the same target and version."],"tags":["build-config","api-usage","generic","operator-list"],"backgroundTag":null,"analyzedSha":"5903d58d58e4dd9ce6ffa3834aea8480f06b4ada","analyzedAt":"2026-08-13T02:28:27.364Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}