1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Build the web/viewer.css file used in the development viewer (i.e. gulp server)

To allow using modern CSS features that currently only Mozilla Firefox supports[1], while still enabling development/testing in recent Google Chrome versions, we'll have to start building the `web/viewer.css` file with `gulp server` as well.

In my testing, building the development CSS (and copying the images) takes *less than* `200 ms` on average which is hopefully an acceptable overhead for this sort of feature.

---
[1] In particular `float`, with `inline-start`/`inline-end` values.
This commit is contained in:
Jonas Jenwald 2022-03-14 12:32:29 +01:00
parent 90c5e9882b
commit e59c2dc308
2 changed files with 33 additions and 0 deletions

View file

@ -199,6 +199,14 @@ function getViewerConfiguration() {
function webViewerLoad() {
const config = getViewerConfiguration();
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
if (window.chrome) {
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = "../build/dev-css/viewer.css";
document.head.appendChild(link);
}
Promise.all([
import("pdfjs-web/genericcom.js"),
import("pdfjs-web/pdf_print_service.js"),