1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

[api-minor] Limit the PDFDocumentLoadingTask.onUnsupportedFeature functionality to GENERIC builds (PR 15758 follow-up)

This was deprecated in PR 15758 but it's unfortunately quite difficult to tell if third-party users are depending on this, e.g. to implement custom error reporting, and if so to what extent.
However, thanks to the pre-processor we can limit *most* of this code to GENERIC builds which still seem like a worthwhile change.

These changes reduce the bundle size of the Firefox PDF Viewer by 3.8 kB in total.
This commit is contained in:
Jonas Jenwald 2023-01-01 16:57:57 +01:00
parent 0c1fb4e740
commit 1a69d537c1
6 changed files with 159 additions and 105 deletions

View file

@ -82,9 +82,11 @@ class Pattern {
if (ex instanceof MissingDataException) {
throw ex;
}
handler.send("UnsupportedFeature", {
featureId: UNSUPPORTED_FEATURES.shadingPattern,
});
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
handler.send("UnsupportedFeature", {
featureId: UNSUPPORTED_FEATURES.shadingPattern,
});
}
warn(ex);
return new DummyShading();
}