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

20109 commits

Author SHA1 Message Date
calixteman
1cdaaadf2d
Merge pull request #18670 from calixteman/bug1911764
[Editor] Remove the disclaimer when the user is editing the alt-text in the new alt-text modal (bug 1911764)
2024-09-04 13:41:18 +02:00
Jonas Jenwald
4b8628637a Improve the StructTreeLayerBuilder.render method
In hindsight it occurred to me that there's a couple of smaller issues with this method after it's made asynchronous (in PR 18658).

 - If the `render`-method is invoked back-to-back the existing caching doesn't guarantee that re-parsing won't occur, which we can address by introducing a new (private) promise.

 - If there's any errors fetching and/or parsing the structTree-data, we'd attempt to parse it again on re-rendering despite that being pointless.
2024-09-04 11:53:51 +02:00
Calixte Denizet
4aea51b5bf [Editor] Remove the disclaimer when the user is editing the alt-text in the new alt-text modal (bug 1911764) 2024-09-04 10:00:35 +02:00
calixteman
d3698223a8
Merge pull request #18658 from calixteman/bug1912001
[Editor] Make the stamp annotations alt text readable by either VO or NVDA (bug 1912001)
2024-09-03 21:47:21 +02:00
Tim van der Meij
082ad955f0
Merge pull request #18673 from Snuffleupagus/use-Headers
Use `Headers` consistently in the different `IPDFStream` implementations
2024-09-03 20:26:35 +02:00
Tim van der Meij
da99f5d6cd
Merge pull request #18679 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-09-03 20:14:37 +02:00
calixteman
a61f4b0303
Merge pull request #18427 from calixteman/edit_highlight
[Editor] Make highlight annotations editable (bug 1883884)
2024-09-03 17:56:37 +02:00
calixteman
5d8d9ef6f9
Merge pull request #18664 from calixteman/bug1911994
[Editor] Make the focused stamp annotation more clear from a screen reader point of view (bug 1911994)
2024-09-03 17:04:21 +02:00
Calixte Denizet
deedbd1c4f [Editor] Make the stamp annotations alt text readable by either VO or NVDA (bug 1912001) 2024-09-03 16:57:41 +02:00
Calixte Denizet
843fde3b13 [Editor] Make the focused stamp annotation more clear from a screen reader point of view (bug 1911994)
It has been tested with Voice Over (mac) and with NVDA (windows).

When an added stamp annotation is focused, the screen reader will announce
that it's a figure containing a graphic with the added alt-text.
2024-09-03 16:38:21 +02:00
Calixte Denizet
a62ceedb69 [Editor] Make highlight annotations editable (bug 1883884)
The goal of this patch is to be able to edit existing highlight annotations.
2024-09-03 15:27:55 +02:00
Jonas Jenwald
d3a94f17cb Use Headers consistently in the different IPDFStream implementations
The `Headers` functionality is now available in all browsers/environments that we support, which allows us to consolidate and simplify how the `httpHeaders` API-option is handled; see https://developer.mozilla.org/en-US/docs/Web/API/Headers#browser_compatibility

Also, simplifies the old `NetworkManager`-constructor a little bit.
2024-09-02 11:56:24 +02:00
Tim van der Meij
8084ae2054
Update translations to the most recent versions 2024-09-01 19:59:22 +02:00
Tim van der Meij
ec7d0f6860
Update dependencies to the most recent versions 2024-09-01 19:58:26 +02:00
Tim van der Meij
0676ea19cf
Merge pull request #18678 from timvandermeij/bump
Bump the stable version in `pdfjs.config`
2024-09-01 19:40:17 +02:00
Tim van der Meij
4220116c1a
Bump the stable version in pdfjs.config 2024-09-01 19:36:48 +02:00
Tim van der Meij
9b541910ff
Merge pull request #18675 from calixteman/nofirefox
Add an option (i.e. --noFirefox) to only use Chrome when running tests
2024-09-01 15:44:00 +02:00
Tim van der Meij
bde7a84e09
Merge pull request #18672 from Snuffleupagus/PDFPageView-AnnotationEditorLayerBuilder-shorter-init
Shorten the code that inits `AnnotationEditorLayerBuilder` in the `web/pdf_page_view.js` file
2024-09-01 15:30:20 +02:00
Tim van der Meij
4a132229c6
Merge pull request #18665 from Snuffleupagus/PDFNodeStream-createRequest
Add a helper function for http/https requests in `src/display/node_stream.js`
2024-09-01 15:27:48 +02:00
Jonas Jenwald
2a68aa62f2
Merge pull request #18674 from Snuffleupagus/full-l10n-ids
Use "full" localization ids throughout the code-base
2024-09-01 10:11:21 +02:00
Calixte Denizet
1b0bfcae3e Add an option (i.e. --noFirefox) to only use Chrome when running tests 2024-08-31 22:29:24 +02:00
Jonas Jenwald
ff762179a6
Merge pull request #18671 from Snuffleupagus/update-l10n
Update l10n files
2024-08-31 21:36:51 +02:00
Jonas Jenwald
b01df28810 Use "full" localization ids throughout the code-base
It was recently brought to my attention that using partial or generated localization ids is bad for maintainability, hence this patch goes through the code-base and replaces any such occurrences.
2024-08-31 18:31:31 +02:00
Jonas Jenwald
044f1c9e07 Shorten the code that inits AnnotationEditorLayerBuilder in the web/pdf_page_view.js file
This code can now utilize logical OR assignment, which is ever so slightly shorter.
2024-08-31 11:58:43 +02:00
Jonas Jenwald
bcc511119e Update l10n files
Given the recent l10n-id changes, let's do one more update before the next release to avoid "broken" translations.
2024-08-31 11:17:38 +02:00
calixteman
7494dbccf4
Merge pull request #18666 from calixteman/update_loading_icon_alt_text
[Editor] Update the loading icon when wait for ML to take into account prefered-reduced-motion setting
2024-08-30 18:38:21 +02:00
Calixte Denizet
36c5d192c7 [Editor] Update the loading icon when wait for ML to take into account prefered-reduced-motion setting
* The icon has been updated in https://bugzilla.mozilla.org/show_bug.cgi?id=1908920;
 * Add a linter to check that a svg element doesn't have fill="context-fill" attribute.
2024-08-30 15:48:51 +02:00
Jonas Jenwald
a94e8ba9e8 Add a helper function for http/https requests in src/display/node_stream.js
Currently we repeat virtually the same http/https request code in two different classes in this file, which seems unnecessary and it leads to more code.
2024-08-29 22:52:26 +02:00
Tim van der Meij
f6216df889
Merge pull request #18663 from Snuffleupagus/PDFDocumentProperties-full-l10n-ids
Use "full" localization ids in the `PDFDocumentProperties` class
2024-08-29 20:58:15 +02:00
Tim van der Meij
5d94047dad
Merge pull request #18657 from nicolo-ribaudo/url
Use the URL global instead of the deprecated url.parse
2024-08-29 20:50:43 +02:00
Jonas Jenwald
39ac3ef1a6 Move the metric-locale check into PDFDocumentProperties.#parsePageSize
With the introduction of Fluent the `getLanguage`-method became synchronous, hence it no longer seems necessary to do the metric-locale check eagerly in the constructor and it can instead be "delayed" until actually needed.
2024-08-29 20:26:11 +02:00
Jonas Jenwald
a6e54160cc Use "full" localization ids in the PDFDocumentProperties class
It was recently brought to my attention that using partial or generated localization ids is bad for maintainability, which means that PR 18636 wasn't the correct thing to do.
However, just reverting that one doesn't really fix the problems which is why this patch updates *every* l10n-id in the `PDFDocumentProperties` class (but doesn't touch any `viewer.ftl`-files). Obviously this leads to more verbose code, but that cannot really be helped.
2024-08-29 20:26:11 +02:00
Tim van der Meij
044e761214
Merge pull request #18655 from Snuffleupagus/PDFDocumentProperties-updateUI-rm-param
Simplify the `PDFDocumentProperties.#updateUI` method
2024-08-29 20:23:04 +02:00
Tim van der Meij
ce656238e3
Merge pull request #18651 from Rob--W/crx-mv3-prep-drop-manifest
[CRX] Remove obsolete manifest features
2024-08-29 20:18:19 +02:00
Tim van der Meij
ea090fec02
Merge pull request #18590 from timvandermeij/puppeteer-23
Upgrade Puppeteer to version 23.1.1
2024-08-29 20:14:19 +02:00
Jonas Jenwald
a5d0e410c7 Simplify the PDFDocumentProperties.#updateUI method
We can remove the `reset`-parameter, since it's redundant, given that it's only used after `PDFDocumentProperties.#reset` has been invoked which means that `this.#fieldData === null` which is equivalent to resetting.
Also, we don't need to have two separate loops in order to update the UI in this method.

Finally, inline the `DEFAULT_FIELD_CONTENT` constant now that it's only used once.
2024-08-29 12:48:11 +02:00
calixteman
a41cd38387
Merge pull request #18661 from calixteman/bug1915434
[Editor] Fix few telemetry issues with the new alt text flow (bug 1915434)
2024-08-28 22:18:21 +02:00
Calixte Denizet
1658b0af55 [Editor] Fix few telemetry issues with the new alt text flow (bug 1915434) 2024-08-28 18:54:15 +02:00
Nicolò Ribaudo
229ad1bb2c
Use the URL global instead of the deprecated url.parse
The Node.js url.parse API (https://nodejs.org/api/url.html#urlparseurlstring-parsequerystring-slashesdenotehost)
is deprecated because it's prone to security issues (to the point that Node.js doesn't even publish CVEs for it anymore).

The official reccomendation is to instead use the global URL constructor, available both in Node.js and in browsers.
Node.js filesystem APIs accept URL objects as parameter, so this also avoids a few URL->filepath conversions.
2024-08-27 18:19:25 +02:00
Jonas Jenwald
ab052db5b3
Merge pull request #18654 from Snuffleupagus/editor-l10n-disclaimer-str
[Editor] Define the "pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer" string once
2024-08-27 15:35:50 +02:00
Jonas Jenwald
d70f5a1952 [Editor] Define the "pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer" string once
This l10n-string is being re-defined once for every editor, i.e. currently four times, which seems unnecessary.
To avoid having to check if this l10n-string exists first, we can utilize rest parameters to move it into the `AnnotationEditor._l10nPromise` Map-definition instead.
2024-08-27 14:59:24 +02:00
Jonas Jenwald
e9a319be2c
Merge pull request #18649 from Snuffleupagus/resizers-fluent
[Editor] Utilize Fluent "better" when localizing the resizer DOM-elements
2024-08-27 14:58:59 +02:00
Jonas Jenwald
ac75a05cd4 [Editor] Utilize Fluent "better" when localizing the resizer DOM-elements
Currently we manually localize and update the DOM-elements of the editor-resizers, and it seems nicer to utilize Fluent for that task.
This can be achieved by updating the l10n-strings to directly target the `aria-label` and then just setting the `data-l10n-id` on the DOM-elements.
2024-08-26 21:32:02 +02:00
calixteman
b58c24ab09
Merge pull request #18650 from calixteman/bug1914480
[Editor] Add a missing parameter in the telemetry for the new alt text flow (bug 1914480)
2024-08-26 15:33:41 +02:00
Rob Wu
1d545382a3 [CRX] Remove obsolete extension API calls
These work arounds are no longer relevant to the latest Chrome versions.
2024-08-25 22:03:38 +02:00
Rob Wu
683b511f20 [CRX] Remove obsolete manifest features
In preparation for migrating the Chrome extension to Manifest Version 3,
this patch removes parts of the manifest that are obsolete and/or
unsupported in MV3.

Remove ftp mentions: ftp was dropped from 6 years ago, in Chrome 59.

Remove file_browser_handlers: does not work on Chrome OS according to
https://github.com/mozilla/pdf.js/issues/14161 . MV3 replacement needs
a different manifest key and logic, which will be added later.

Remove content_security_policy: MV3 does not support unsafe-eval CSP,
and PDF.js does not require it. This may result in a mild performance
degradation in PDFs that contain PostScript.

Remove page_action logic: When this logic was originally introduced,
Chrome showed page action buttons in the address bar, which enabled
the extension to display the button on specific PDF viewer tabs only.
In Chrome 49 (2016), pageActions were dropped from the address bar and
put in an UI area that is hidden by default. The user can pin the button
to be unconditionally visible on the toolbar, which is distracting.
Because the UX is no longer serving the original needs, this patch
removes page_action from the manifest.
2024-08-25 20:34:03 +02:00
Calixte Denizet
e8763a08ab [Editor] Add a missing parameter in the telemetry for the new alt text flow (bug 1914480) 2024-08-25 17:33:42 +02:00
Tim van der Meij
54eead78ab
Upgrade Puppeteer to version 23.1.1
This major version contains three breaking changes that impact us:

- The `product` option has been renamed to the more suitable `browser`.
- The `page.screenshot()` API returns a `Uint8Array` instead of a
  `Buffer`, but since `pngjs` requires a `Buffer` object we need to do
  the conversion using `Buffer.from()` before passing data to `pngjs`.
- The browser configuration should be set using a configuration file
  instead of environment variables. Note that as a bonus this allows us
  to remove the `cross-env` dependency since that was only used to set
  the Puppeteer environment variable equally for all operating systems.

For more information about the changes between the old and new Puppeteer
versions refer to https://github.com/puppeteer/puppeteer/releases.
2024-08-25 12:49:20 +02:00
Tim van der Meij
cd99be0aa5
Merge pull request #18638 from Snuffleupagus/PDFDocumentProperties-l10n-functions
Utilize Fluent to format numbers and dates in `PDFDocumentProperties`/`AnnotationLayer`
2024-08-25 12:44:15 +02:00
Tim van der Meij
de365b69fa
Merge pull request #18648 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-08-25 12:39:52 +02:00