5001 Commits

Author SHA1 Message Date
Calixte Denizet
e1f02be670
Pass the global signal the text layer builder in order to remove all the listeners defined here
The goal of this patch is to remove the noice we've in the logs:
```
 0:09.36 INFO Console message: [JavaScript Warning: "Script terminated by timeout at:
reset@resource://pdf.js/web/viewer.mjs:11773:7
EventListener.handleEvent*#enableGlobalSelectionListener@resource://pdf.js/web/viewer.mjs:11787:12
render@resource://pdf.js/web/viewer.mjs:11716:20
async*#renderTextLayer@resource://pdf.js/web/viewer.mjs:12108:28
draw/resultPromise<@resource://pdf.js/web/viewer.mjs:12575:53
promise callback*draw@resource://pdf.js/web/viewer.mjs:12570:8
renderView@resource://pdf.js/web/viewer.mjs:7872:14
forceRendering/<@resource://pdf.js/web/viewer.mjs:13963:29
" {file: "resource://pdf.js/web/viewer.mjs" line: 11773}]
```
2026-03-20 18:06:39 +01:00
calixteman
5bdeb79b09
Merge pull request #20926 from calixteman/bug2022516
Correctly focus the pasted page (bug 2022516)
2026-03-20 17:47:02 +01:00
calixteman
2c5812006a
Merge pull request #20929 from calixteman/bug2022481
Add the basic telemetry for Organize feature (bug 2022481)
2026-03-20 17:44:19 +01:00
calixteman
16aee06aac
Merge pull request #20925 from calixteman/reorganize_save_annotations
Add the possibility to save added annotations when reorganizing a pdf (bug 2023086)
2026-03-20 16:32:10 +01:00
Calixte Denizet
008181a43e
Add the basic telemetry for Organize feature (bug 2022481) 2026-03-20 14:33:55 +01:00
Calixte Denizet
4aee2e8f2c Correctly focus the pasted page (bug 2022516) 2026-03-20 11:39:57 +01:00
Calixte Denizet
04272de41d
Add the possibility to save added annotations when reorganizing a pdf (bug 2023086) 2026-03-20 10:55:47 +01:00
Calixte Denizet
1db3774540 Make sure the menuitems are readable when hovering them (bug 2023138)
Simplify a bit the html for the menu: remove the li elements.
Make sure the the menuitems are exposed when disabled.
2026-03-20 10:01:45 +01:00
calixteman
a98449510c
Merge pull request #20913 from calixteman/new_badge
Add a new badge close to the Manage button in the sidebar.
2026-03-18 21:38:47 +01:00
calixteman
e65d643af5
Merge pull request #20907 from calixteman/fix_bad_bugs
Fix various bug around copy/paste/delete/undo (bug 2022586, bug 2022824, bug 2022884, bug 2023171, bug 2023176)
2026-03-18 21:38:15 +01:00
Calixte Denizet
85d88e59f3
Add a new badge close to the Manage button in the sidebar. 2026-03-18 21:05:00 +01:00
Calixte Denizet
75cb69eef2
Fix various bug around copy/paste/delete/undo (bug 2022586, bug 2022824, bug 2022884, bug 2023171, bug 2023176)
Those bugs are more or less related so it's why they're all fixed together in the same patch.
2026-03-18 13:57:20 +01:00
Calixte Denizet
bab17136ed Fix the outline of the deselect button in the sidebar (bug 2024156)
I noticed a typo in class name (hiddden for hidden) and I found few others I fixed.
2026-03-18 12:53:48 +01:00
calixteman
979d9c3091
Merge pull request #20895 from calixteman/issue20893
Fix the position of 'Attachments' in the sidebar
2026-03-18 11:24:22 +01:00
Calixte Denizet
96d1465aab Allow to collapse/expand all the outlines in double clicking somewhere on the header bar (bug 2019550) 2026-03-18 10:26:04 +01:00
Calixte Denizet
44f4627600 Fix the position of 'Attachments' in the sidebar
It fixes #20893.
2026-03-18 10:09:23 +01:00
Calixte Denizet
5493585b54
Try to fix few intermittents bug in reorganize_pages_spec integration tests 2026-03-16 22:00:42 +01:00
Tim van der Meij
0a2c030c8b
Merge pull request #20888 from calixteman/debugger_skip_ops
Add the possibility to skip some ops in the debug view
2026-03-16 20:36:48 +01:00
Tim van der Meij
481a0cbe62
Merge pull request #20889 from calixteman/debugger_search_btns
(Debugger) Replace checkboxes in the search bar by toggle buttons
2026-03-16 20:35:17 +01:00
calixteman
fc286aac4e
(Debugger) Don't draw the checkerboard on the canvas but add it behind 2026-03-15 23:20:18 +01:00
calixteman
c7837580b9
(Debugger) Replace checkboxes in the search bar by toggle buttons 2026-03-15 22:46:13 +01:00
calixteman
e85c30e08a
Add the possibility to skip some ops in the debug view
The user has to click in the space before an op to add a breakpoint
and click again in order to skip it.
2026-03-15 22:25:45 +01:00
Tim van der Meij
c2acab55d9
Merge pull request #20765 from calixteman/update_eslint
Update eslint to version 10
2026-03-15 20:26:09 +01:00
calixteman
d5ac981d62
Update eslint to version 10
Unfortunately, eslint-plugin-import depends on eslint 9. This plugin doesn't seem to be
actively maintained (lot of open issues and PRs).
Fortunately there's a fork of the plugin that doesn't support eslint 10 yet but is actively maintained.
So this PR changes the eslint version to 10 and replaces eslint-plugin-import with eslint-plugin-import-x.
2026-03-15 19:36:54 +01:00
Jonas Jenwald
e05df11e98 Increase the maximum viewer scale to 2500 percent
After PR 19128 huge zoom levels should no longer be an issue, so let's increase the maximum viewer scale a bit.
2026-03-15 15:45:34 +01:00
calixteman
a3a205d69b
Merge pull request #20871 from calixteman/refactor_debugger
Split the new debugger into multiple files
2026-03-15 14:29:13 +01:00
calixteman
7bac644731
Split the new debugger into multiple files
Instead of having all the code for the new debugger in a single file,
split it into multiple files.
This makes it easier to navigate and maintain the codebase.
It'll be make hacking and fixing bugs in the debugger easier.
2026-03-15 13:21:26 +01:00
Tim van der Meij
820b70eb25
Merge pull request #20858 from calixteman/move_save_as_to_export_selected
Move 'Save as...' menu to 'Export selected...'
2026-03-13 22:04:12 +01:00
Tim van der Meij
94b7f8f998
Merge pull request #20863 from calixteman/fix_intermittent_undo_bar
Only focus the undo bar when the focus isn't inside
2026-03-13 22:03:45 +01:00
Jonas Jenwald
75739a173b Bundle the necessary files and set the correct cMapUrl, iccUrl, and standardFontDataUrl when building gulp internal-viewer
Without these changes none of the relevant functionality would work in the *built* internal-viewer.
2026-03-13 18:16:10 +01:00
calixteman
1d25607b9c
Move 'Save as...' menu to 'Export selected...' 2026-03-13 17:29:12 +01:00
Calixte Denizet
df4a5638d0
Add a button for unchecking all the checked thumbnails (bug 2022769) 2026-03-13 14:18:51 +01:00
calixteman
fbfccebb81
Merge pull request #20850 from calixteman/bug2021828
Don't let the user delete/cut all the pages (bug 2021828)
2026-03-13 14:06:01 +01:00
Calixte Denizet
bbf178c5ee Only focus the undo bar when the focus isn't inside
It should fix the test "must work properly when selecting undo by keyboard"
which calls focus() but it can be steal by fixed callback in setTimeout.
2026-03-13 13:53:51 +01:00
calixteman
2381ac6b16
Update the internal viewer to use a new debugger.
It has few cool features:
 - all the canvas used during the rendering can be viewed;
 - the different properties in the graphics state can be viewed;
 - the different paths can be viewed.
2026-03-12 22:38:08 +01:00
Calixte Denizet
1291f5a32b
Don't let the user delete/cut all the pages (bug 2021828)
And dispatch an event only when the context menu is displayed.
2026-03-11 17:23:56 +01:00
Jonas Jenwald
63b4874b39 Remove the enableHWA option from viewer components (PR 20016 follow-up)
In PR 20016 the actual uses of the `enableHWA` option was removed from the viewer, but for some reason it's still being provided when initializing `PDFViewer` and `PDFThumbnailViewer` despite the fact that it's now dead code.
2026-03-11 15:28:43 +01:00
calixteman
9d093d9607
Merge pull request #20626 from nicolo-ribaudo/images-right-click
Add support for right-clicking on images (bug 1012805)
2026-03-11 11:45:51 +01:00
calixteman
98f7e859ac
Merge pull request #20837 from calixteman/bug2021934
Disable dragging a thumbnail when the user has to paste what they copied (bug 2021934)
2026-03-11 09:13:25 +01:00
Tim van der Meij
44a63549b0
Merge pull request #20831 from calixteman/internal_viewer
Add a new internal viewer to explore the structure of PDF files.
2026-03-10 20:48:40 +01:00
Tim van der Meij
bf20d3c7e8
Merge pull request #20838 from calixteman/bug2021886
Avoid to have a thumbnail with two paste buttons (bug 2021886)
2026-03-10 20:21:34 +01:00
Tim van der Meij
99dcb88dac
Merge pull request #20834 from calixteman/update_context_menu
Update the context menu after copying thumbnails
2026-03-10 20:15:51 +01:00
Tim van der Meij
0dce6f40d2
Merge pull request #20839 from calixteman/bug2020698
Fix the border & background colors of the placeholder for a dragged thumbnail (bug 2020698)
2026-03-10 20:14:05 +01:00
Jonas Jenwald
bfa2753f3c Remove the "abort" listener, on the globalAbortSignal, in the web/sidebar.js file
This is consistent with a bunch of other viewer code, since an `AbortSignal` can only be aborted once any "abort" listeners can thus be removed when invoked.
2026-03-10 15:51:10 +01:00
Nicolò Ribaudo
886c90d1a5
Add support for right-clicking on images
This patch adds right-click support for images in the PDF, allowing
users to download them. To minimize memory consumption, we:
- Do not store the images separately, and instead crop them out of the
  PDF page canvas
- Only extract the images when needed (i.e. when the user right-clicks
  on them), rather than eagery having all of them available.

To do so, we layer one empty 0x0 canvas per image, stretched to cover
the whole image, and only populate its contents on right click.
These images need to be inside the text layer: they cannot be _behind_
it, otherwise they would be covered by the text layer's container and
not be clickable, and they cannot be in front of it, otherwise they
would make the text spans unselectable.

This feature is managed by a new preference, `imagesRightClickMinSize`:
- when it's set to `-1`, right-click support is disabled
- when set to `0`, all images are available for right click
- when set to a positive integer, only images whose width and height are
  greater than or equal to that value (in the PDF page frame of
  reference) are available for right click.

This features is disabled by default outside of MOZCENTRAL, as it
significantly degrades the text selection experience in non-Firefox
browsers.
2026-03-10 14:51:03 +01:00
Calixte Denizet
ad7a415220
Fix the border & background colors of the placeholder for a dragged thumbnail (bug 2020698) 2026-03-09 20:47:39 +01:00
Calixte Denizet
645ef08764
Avoid to have a thumbnail with two paste buttons (bug 2021886) 2026-03-09 19:10:12 +01:00
Calixte Denizet
7010086cd5
Disable dragging a thumbnail when the user has to paste what they copied (bug 2021934) 2026-03-09 18:10:33 +01:00
Calixte Denizet
210b859a54
Update the context menu after copying thumbnails 2026-03-09 15:36:22 +01:00
Calixte Denizet
18a05354fb
Fix the label and tooltip on the paste buttons 2026-03-09 14:21:15 +01:00