Commit Graph

10 Commits

Author SHA1 Message Date
Calixte Denizet
a652dc85e4 [GeckoView] Add a button to download and open the file in an external app (bug 1829367) 2023-05-05 15:52:15 +02:00
Jonas Jenwald
804aa896a7 Stop using the PRODUCTION build-target in the JavaScript code
This *special* build-target is very old, and was introduced with the first pre-processor that only uses comments to enable/disable code.
When the new pre-processor was added `PRODUCTION` effectively became redundant, at least in JavaScript code, since `typeof PDFJSDev === "undefined"` checks now do the same thing.

This patch proposes that we remove `PRODUCTION` from the JavaScript code, since that simplifies the conditions and thus improves readability in many cases.
*Please note:* There's not, nor has there ever been, any gulp-task that set `PRODUCTION = false` during building.
2023-04-17 12:04:34 +02:00
Jonas Jenwald
2fbbdd68cc Create the "hiddenCopyElement" in the PDFViewer constructor (PR 16286 follow-up)
To make this functionality work out-of-the-box in custom implementations, see e.g. the "viewer components" examples, it'd be slightly easier if we dynamically create/insert the "hiddenCopyElement" in the `PDFViewer` constructor.
Given that the "copy all text" feature still appears to work just as before with this patch, hopefully I'm not overlooking any reason why doing this would be a bad idea.
2023-04-16 09:14:05 +02:00
Calixte Denizet
ca54ea12b3 Add the possibility to copy all the pdf text whatever the rendered pages are (bug 1788035) 2023-04-15 18:59:40 +02:00
Calixte Denizet
3b147205ba [GeckoView] Add a basic toolbar with a download button for GV (bug 1823164) 2023-04-07 11:54:16 +02:00
Jonas Jenwald
90ffbc1d39 Remove most build-time require statements from the viewer (PR 16009 follow-up)
This further extends the web-specific import maps introduced in PR 16009, to allow removing *most* of the build-time `require` statements from the viewer. The few remaining ones are fallbacks used for the COMPONENTS respectively the `legacy` GENERIC builds.
2023-02-07 22:45:19 +01:00
Jonas Jenwald
8f37301d1f Remove the "div-css" gulp task (PR 15968 follow-up)
After the compatibility updates in PR 15968 it's no longer strictly necessary to build the `viewer.css` file in order for the *development viewer* to work in Chromium-based browsers.

*Please note:* Given that Chromium-based browsers still don't support the *unprefixed* `mask-image` property the icons won't look right, however the development viewer itself works.
Given that Firefox is the *primary* development target, and that running `gulp generic` locally will generate polyfilled CSS, it seems reasonable to make this simplification here.
2023-02-07 21:37:41 +01:00
Jonas Jenwald
8c4843f69a [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.
2023-02-07 16:07:12 +01:00
Calixte Denizet
409c8b344f [GV] Remove print stuff because window.print isn't implemented (bug 1808668) 2023-01-05 13:02:29 +01:00
Calixte Denizet
f19572c4cc [GV] Add a viewer for GeckoView 2022-12-15 13:39:48 +01:00