[GeckoView] Introduce a development mode constant to tell the viewers apart

Currently we have a couple of pre-processor checks, specifically for the GV-viewer, spread throughout the code. This works fine when *building* the viewer, however they're obviously ignored in development mode (i.e. `gulp server`).
This leads to a situation where the GV development viewer, i.e. http://localhost:8888/web/viewer-geckoview.html, behaves subtly different from its built version. This could easily lead to bugs, hence this patch introduces a development mode constant to hopefully improve things here.

Finally, in a follow-up to PR 15842, also ignores the `pageMode`-state since there's no sidebar available.
This commit is contained in:
Jonas Jenwald 2023-02-07 16:07:12 +01:00
parent c971f4a0a9
commit 8c4843f69a
3 changed files with 27 additions and 17 deletions

View file

@ -269,7 +269,9 @@ class PDFScriptingManager {
// NOTE: Always ignore the pageLayout in GeckoView since there's
// no UI available to change Scroll/Spread modes for the user.
if (
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("GECKOVIEW")) ||
(typeof PDFJSDev === "undefined"
? window.isGECKOVIEW
: PDFJSDev.test("GECKOVIEW")) ||
isInPresentationMode
) {
return;