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

19649 commits

Author SHA1 Message Date
Jonas Jenwald
2883a9460e Remove ununsed static HighlightEditor._l10nPromise field 2024-09-10 10:00:41 +02:00
calixteman
5b4c2fe1a8
Merge pull request #18716 from calixteman/stamp_auto_resize
[Editor] Avoid to have a stamp editor resizing itself
2024-09-09 22:13:49 +02:00
calixteman
f98e6040cd
Merge pull request #18719 from calixteman/bug1917543
[Editor] Avoid to have the ML disclaimer when the ML engine isn't ready (bug 1917543)
2024-09-09 22:12:46 +02:00
calixteman
95cd848e3b
Merge pull request #18718 from calixteman/bug1916714
[JS] Let AFSpecial_KeystrokeEx match a format without 'decoration' (bug 1916714)
2024-09-09 21:50:46 +02:00
Calixte Denizet
6e4b7ee3f8 [Editor] Avoid to have the ML disclaimer when the ML engine isn't ready (bug 1917543) 2024-09-09 21:47:18 +02:00
Calixte Denizet
3f23bcbecc [Editor] Avoid to have a stamp editor resizing itself
Fixes #18715.
2024-09-09 21:31:55 +02:00
Tim van der Meij
5f39b592c5
Merge pull request #18708 from timvandermeij/updates
Update dependencies and translations to the most recent versions
2024-09-09 21:23:16 +02:00
Calixte Denizet
bae32b4fd2 [JS] Let AFSpecial_KeystrokeEx match a format without 'decoration' (bug 1916714)
It'll let the user enter 1234567 instead of 123-4567 for example.
It works like this in other pdf viewers.
2024-09-09 20:29:14 +02:00
Tim van der Meij
8e5f06d77d
Merge pull request #18711 from Rob--W/crx-mv3-fallback-detect
[CRX] Detect availability of DNR responseHeaders before use
2024-09-09 20:00:44 +02:00
Tim van der Meij
2f2d74ba5c
Update translations to the most recent versions 2024-09-09 19:51:21 +02:00
Tim van der Meij
ae13b4a015
Update dependencies to the most recent versions 2024-09-09 19:51:21 +02:00
Rob Wu
9705169371 [CRX] Detect availability of DNR responseHeaders before use
Critical fix for old but recent Chrome versions; all requests are
otherwise redirected to the viewer.
2024-09-09 14:41:00 +02:00
Tim van der Meij
a1b45d6e69
Merge pull request #18681 from Rob--W/crx-mv3-migration
[CRX] Migrate Chrome extension to Manifest Version 3
2024-09-08 18:10:43 +02:00
Rob Wu
4bf7be6427 [CRX] Bump minimum_chrome_version from 88 to 103
The minimum required version is Chrome 103 because wildcard support for
web_accessible_resources[].extension_id was introduced in 103, in
c9caeb1a08

A way to broaden compatibility is to drop that key. By doing so, the
minimum required Chrome version is then 96, because of the
chrome.storage.session API (and declarativeNetRequestWithHostAccess).

Since gulpfile.js already defines "Chrome >= 98" and there is no real
point in expanding support to older versions, I'm just setting the
minimum version to 103.
2024-09-08 16:35:14 +02:00
Rob Wu
b3a0ad09ad [CRX] Add work-around for Chrome crash 2024-09-08 16:35:14 +02:00
Rob Wu
4327502bf3 [CRX] Add fallback PDF detection for Chrome 127- 2024-09-08 16:35:14 +02:00
Rob Wu
3fe256cd0d [CRX] Set manifest_version to 3
- Replace DOM-based pdfHandler.html (background page) with background.js
  (extension service worker).

- Adjust logic of background scripts to account for the fact that the
  scripts can execute repeatedly during a browser session. Primarily,
  register relevant extension event handlers at the top level and use
  in-memory storage.session API to keep track of initialization state.

- Extension URL router: replace blocking webRequest with the service
  worker-specific "fetch" event.

- PDF detection: replace blocking webRequest with declarativeNetRequest.
  This requires Chrome 128+. The next commit will add a fallback for
  earlier Chrome versions.
2024-09-08 16:35:13 +02:00
Rob Wu
7017d8246b [CRX] Replace localStorage in telemetry logic
In MV3, the background script is a service worker. localStorage is not
supported in service workers. Switch to storage.local instead.

Data migration is not implemented because it is not needed due to the
privacy-friendly design of the telemetry: In practice the data is reset
about every 4 weeks, when the major version of Chrome is updated.
2024-09-08 16:35:13 +02:00
Rob Wu
bc4890d4d4 [CRX] Remove restoretab.js logic
restoretab.js was added in https://github.com/mozilla/pdf.js/pull/6233
with the purpose of restoring lost tabs when Chrome closes all extension
tabs when it reloads the extension. This forced reload can happen when
the user toggles the "Allow access to file URLs" option.

This logic does not work any more, and since the use of localStorage is
a blocker in migrating to MV3, this patch just drops the logic.
2024-09-08 16:35:13 +02:00
Rob Wu
23bc46d51a [CRX] Replace deprecated extension.getURL with runtime.getURL 2024-09-08 16:35:13 +02:00
Rob Wu
b23829fc60 [CRX] Drop chrome_style from manifest.json
MV3 does not support chrome_style in options_ui. Remove it and replace
it with the minimal amount of styles that still has some spacing around
the individual settings for readability.
2024-09-08 16:35:13 +02:00
Rob Wu
bd3d993180 [CRX] Use DNR instead of webRequest in preserve-referer
webRequestBlocking is unavailable in MV3. Non-blocking webRequest can
still be used to detect the Referer, but we have to use
declarativeNetRequest to change the Referer header as needed.
2024-09-08 16:35:13 +02:00
Tim van der Meij
578549487f
Merge pull request #18707 from Snuffleupagus/pr-18596-followup
Prevent `.visibleMediumView` from overriding already hidden elements (issue 18704, PR 18596 follow-up)
2024-09-08 12:00:44 +02:00
Tim van der Meij
c159cb1335
Merge pull request #18682 from Snuffleupagus/responseHeaders
Use response-`Headers` in the different `IPDFStream` implementations
2024-09-08 11:49:50 +02:00
Jonas Jenwald
b681ea6fd9 Prevent .visibleMediumView from overriding already hidden elements (issue 18704, PR 18596 follow-up)
*Please note:* As a general rule we probably don't need to fix things affecting *custom* implementations of the default viewer, but in this case a "targeted" fix seem possible that shouldn't (famous last words) break anything else.

Ensure that the `.visibleMediumView` class, which is used when the viewer becomes narrow, cannot override the `display`-value for DOM elements that are being *explicitly* hidden either through the associated attribute or class.
2024-09-08 10:47:18 +02:00
Jonas Jenwald
5d0c82cf05
Merge pull request #18706 from Snuffleupagus/AltText-full-l10n-ids
Use "full" localization ids in the `AltText` class (PR 18674 follow-up)
2024-09-07 23:20:09 +02:00
Jonas Jenwald
727454600b
Merge pull request #18705 from Snuffleupagus/ColorPicker-full-l10n-ids
Use "full" localization ids in the `ColorPicker` class (PR 18674 follow-up)
2024-09-07 23:19:28 +02:00
calixteman
5369a24c9c
Merge pull request #18698 from calixteman/issue18694
Avoid to have a white line around the canvas
2024-09-07 22:22:21 +02:00
Calixte Denizet
68332ec236 Avoid to have a white line around the canvas
The canvas must have the same dims as the page in order to avoid to see the page
background.
2024-09-07 20:12:29 +02:00
Jonas Jenwald
0ffd99acc5 Use "full" localization ids in the AltText class (PR 18674 follow-up)
Apparently I missed these in PR 18674.
2024-09-07 16:38:21 +02:00
Jonas Jenwald
931090328d Use "full" localization ids in the ColorPicker class (PR 18674 follow-up)
Apparently I missed these in PR 18674.
2024-09-07 15:53:01 +02:00
Jonas Jenwald
2a01931e4a Use the _headersCapability name in PDFNetworkStreamFullRequestReader
This improves consistency in the code-base since the implementations with the Fetch API respectively Node.js uses that name.
2024-09-07 12:36:34 +02:00
Jonas Jenwald
840cc5e0d4 Use response-Headers in the different IPDFStream implementations
Given that the `Headers` functionality is now available in all browsers/environments that we support, [see MDN](https://developer.mozilla.org/en-US/docs/Web/API/Headers#browser_compatibility), we can utilize "proper" `Headers` in the helper functions that are used to parse the response.
2024-09-07 12:34:53 +02:00
calixteman
77c7ec6927
Merge pull request #18692 from calixteman/bug1708040
Make tagged images visible for screen readers (bug 1708040)
2024-09-05 18:50:22 +02:00
Calixte Denizet
ddba096191 Make tagged images visible for screen readers (bug 1708040)
The idea is to insert a span in the text layer with an aria-role set to img
and use the bounding box provided by the attribute field in the tag dict in
order to have non-null dimensions for the image to make it "visible".
2024-09-05 17:59:42 +02:00
calixteman
4b906ad0a8
Merge pull request #18697 from calixteman/issue18696
[Editor] Avoid to throw when an highlight annotation is resetted
2024-09-05 16:15:23 +02:00
Calixte Denizet
350e3e7b1c [Editor] Avoid to throw when an highlight annotation is resetted 2024-09-05 15:31:49 +02:00
calixteman
e3fd62d726
Merge pull request #18690 from calixteman/print_test_afterprint
In the autoprint integration test, resolve the promise on 'afterprint' event
2024-09-04 15:44:05 +02:00
calixteman
4fb045b9eb
Merge pull request #18689 from Snuffleupagus/StructTreeLayerBuilder-render-caching
Improve the `StructTreeLayerBuilder.render` method
2024-09-04 14:07:18 +02:00
Calixte Denizet
5d622ada04 In the autoprint integration test, resolve the promise on 'afterprint' event 2024-09-04 13:49:02 +02:00
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