Commit Graph

100 Commits

Author SHA1 Message Date
Noemi Erli
90b5fb50ca Backed out changeset 10ac3f66133d (bug 1896232) for causing bug 1915806 CLOSED TREE 2024-08-30 16:33:37 +03:00
Niklas Baumgardner
0fc89881f5 Bug 1896232 - Wait for screenshot to download before closing overlay. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216083
2024-08-29 03:21:44 +00:00
Iulian Moraru
6faba7e3b9 Backed out 2 changesets (bug 1908205, bug 1896232) for causing bc assertion failures on nsUrlClassifierDBService.cpp. CLOSED TREE
Backed out changeset 859b4c639883 (bug 1908205)
Backed out changeset 519e88d21955 (bug 1896232)
2024-08-22 22:20:42 +03:00
Niklas Baumgardner
ae2879abd5 Bug 1908205 - Switch to OffscreenCanvas and blobs for screenshots. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216723
2024-08-22 18:36:48 +00:00
Niklas Baumgardner
b0381f7136 Bug 1896232 - Wait for screenshot to download before closing overlay. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216083
2024-08-22 18:36:48 +00:00
Narcis Beleuzu
073a988929 Backed out 2 changesets (bug 1908205, bug 1896232) for causing mochitests failures . CLOSED TREE
Backed out changeset 873bbe70aa8c (bug 1908205)
Backed out changeset 0385fdac5693 (bug 1896232)
2024-08-19 19:04:38 +03:00
Niklas Baumgardner
10850a95fb Bug 1908205 - Switch to OffscreenCanvas and blobs for screenshots. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216723
2024-08-19 14:40:42 +00:00
Niklas Baumgardner
ee55b5699a Bug 1896232 - Wait for screenshot to download before closing overlay. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D216083
2024-08-19 14:40:42 +00:00
Niklas Baumgardner
0e39bf8f0c Bug 1894516 - Make screenshots face focusable via the keyboard. r=sfoster,desktop-theme-reviewers,fluent-reviewers,bolsson,ayeddi
Differential Revision: https://phabricator.services.mozilla.com/D213100
2024-07-29 16:59:14 +00:00
Norisz Fay
57a529f668 Backed out changeset 41d7f0b670ae (bug 1894516) for causing bc failures on browser_screenshots_focus_test.js CLOSED TREE 2024-07-25 23:50:34 +03:00
Niklas Baumgardner
68f4030f56 Bug 1894516 - Make screenshots face focusable via the keyboard. r=sfoster,desktop-theme-reviewers,fluent-reviewers,bolsson,ayeddi
Differential Revision: https://phabricator.services.mozilla.com/D213100
2024-07-25 14:32:27 +00:00
Niklas Baumgardner
d39a577986 Bug 1902303 - Focus browser before taking screenshot. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D213673
2024-06-25 16:16:32 +00:00
Narcis Beleuzu
ef43341f2c Backed out changeset 857a001b61ac (bug 1902303) for bc failures on browser_screenshots_telemetry_tests.js. CLOSED TREE 2024-06-18 02:32:29 +03:00
Niklas Baumgardner
09746b47b2 Bug 1902303 - Focus browser before taking screenshot. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D213673
2024-06-17 15:13:44 +00:00
Niklas Baumgardner
0625ba53c8 Bug 1896002 - Enable screenshots preview buttons if download fails. r=sfoster,kcochrane
Differential Revision: https://phabricator.services.mozilla.com/D209979
2024-05-15 13:44:24 +00:00
Niklas Baumgardner
9bcd4d4100 Bug 1801957 - Create region with keyboard for screenshots. r=sfoster,firefox-desktop-core-reviewers ,accessibility-frontend-reviewers,Gijs,morgan
The problem I'm trying to solve: There is currently no way to create a selected region in the screenshots overlay with the keyboard.
I recently added support for resizing a selected region in bug 1801954, but a user still needs to create a region with the mouse before the keyboard can be used.

I tried to look at what other browsers are doing in this scenario. Unfortunately there isn't much to go off. Most browsers, I can't even take a screenshot and the only browser that I found to have keyboard support for screenshots is MS Edge. In Edge, when you open screenshots, if your mouse isn't over the content area it will immediately move your mouse to the center of the page. If your mouse is over the content, it remains in place. Then, arrow keys will move the cursor around and you can hit space/enter to start creating a region.

I didn't like that Edge moved the mouse immediately after opening screenshots so I took a different approach.

My approach:
Screenshots will not move the mouse until an arrow key is pressed.
How it works:
If your cursor is above the content and an arrow key is pressed, the cursor will move in the direction of the arrow key that was pressed.
If your cursor is not above the content and a arrow key is pressed, the cursor will be moved to the middle of the content. Screenshots will not move the cursor until an arrow key is pressed.

When moving around the overlay with the keyboard: only hitting an arrow key will move the cursor around by 1px. If shift + arrow key, the cursor will move around by 10px.
When space is clicked while moving the cursor, it will start a region. Moving the arrow keys allows the region to sized.
When the cursor is above an element and the hover element rect is visible, hitting enter will select that region. If no hover element region exists, enter will behave the same as space.

I am also keeping the screenshots UI focused in this patch. Tab/shift + tab will keep focus to screenshots UI. Shift + F6 will escape the focus loop I've made in this patch if needed. Although, if a user has entered screenshots, it makes sense that for the current time, only screenshots UI is focusable.

Differential Revision: https://phabricator.services.mozilla.com/D197703
2024-05-03 22:05:52 +00:00
Niklas Baumgardner
cff46be6e9 Bug 1894740 = Wait for image load before trying to save or copy. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D209295
2024-05-03 14:29:40 +00:00
Cristian Tuns
f3f0feda63 Backed out changeset 91e7087aef18 (bug 1801957) for causing bc failures in browser_keyboard_tests.js CLOSED TREE 2024-05-02 12:14:10 -04:00
Niklas Baumgardner
f00889c4fc Bug 1801957 - Create region with keyboard for screenshots. r=sfoster,firefox-desktop-core-reviewers ,accessibility-frontend-reviewers,Gijs,morgan
The problem I'm trying to solve: There is currently no way to create a selected region in the screenshots overlay with the keyboard.
I recently added support for resizing a selected region in bug 1801954, but a user still needs to create a region with the mouse before the keyboard can be used.

I tried to look at what other browsers are doing in this scenario. Unfortunately there isn't much to go off. Most browsers, I can't even take a screenshot and the only browser that I found to have keyboard support for screenshots is MS Edge. In Edge, when you open screenshots, if your mouse isn't over the content area it will immediately move your mouse to the center of the page. If your mouse is over the content, it remains in place. Then, arrow keys will move the cursor around and you can hit space/enter to start creating a region.

I didn't like that Edge moved the mouse immediately after opening screenshots so I took a different approach.

My approach:
Screenshots will not move the mouse until an arrow key is pressed.
How it works:
If your cursor is above the content and an arrow key is pressed, the cursor will move in the direction of the arrow key that was pressed.
If your cursor is not above the content and a arrow key is pressed, the cursor will be moved to the middle of the content. Screenshots will not move the cursor until an arrow key is pressed.

When moving around the overlay with the keyboard: only hitting an arrow key will move the cursor around by 1px. If shift + arrow key, the cursor will move around by 10px.
When space is clicked while moving the cursor, it will start a region. Moving the arrow keys allows the region to sized.
When the cursor is above an element and the hover element rect is visible, hitting enter will select that region. If no hover element region exists, enter will behave the same as space.

I am also keeping the screenshots UI focused in this patch. Tab/shift + tab will keep focus to screenshots UI. Shift + F6 will escape the focus loop I've made in this patch if needed. Although, if a user has entered screenshots, it makes sense that for the current time, only screenshots UI is focusable.

Differential Revision: https://phabricator.services.mozilla.com/D197703
2024-05-02 15:34:39 +00:00
Niklas Baumgardner
286abf76a1 Bug 1892125 - Refactor screenshots preview. r=sfoster,fluent-reviewers,desktop-theme-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D207884
2024-04-30 23:55:55 +00:00
Sam Foster
02bab4e783 Bug 1818862 - Revise how we generate a filename to fit inside platform pathname length constraints. r=niklas
Differential Revision: https://phabricator.services.mozilla.com/D171632
2024-04-18 23:44:17 +00:00
Iulian Moraru
513fc5346b Backed out changeset a188fd9e5365 (bug 1818862) for causing bc failures on browser_screenshots_download_filenames.js. CLOSED TREE 2024-04-18 06:40:48 +03:00
Sam Foster
14c6e7ba56 Bug 1818862 - Revise how we generate a filename to fit inside platform pathname length constraints. r=niklas
Differential Revision: https://phabricator.services.mozilla.com/D171632
2024-04-17 23:37:19 +00:00
Niklas Baumgardner
1abddd1c95 Bug 1864038 - Add keyboard shortcuts for screenshots overlay. r=sfoster,fluent-reviewers,bolsson,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D193847
2024-04-03 23:51:56 +00:00
Cristian Tuns
83896edc65 Backed out changeset d41d18cecc78 (bug 1864038) for causing bc failures in browser_screenshots_drag_scroll_test.js CLOSED TREE 2024-04-02 12:41:01 -04:00
Niklas Baumgardner
c7874fdeb6 Bug 1864038 - Add keyboard shortcuts for screenshots overlay. r=sfoster,fluent-reviewers,bolsson,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D193847
2024-04-02 15:53:57 +00:00
Norisz Fay
61257b3d08 Backed out changeset 13111643fbf4 (bug 1864038) for causing bc failures on browser_screenshots_drag_scroll_test.js CLOSED TREE 2024-04-02 05:04:20 +03:00
Niklas Baumgardner
70450dd2d1 Bug 1864038 - Add keyboard shortcuts for screenshots overlay. r=sfoster,fluent-reviewers,bolsson,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D193847
2024-04-01 22:33:12 +00:00
Narcis Beleuzu
8e1286070a Backed out changeset 4bcd94d558a6 (bug 1864038) for bc failure on browser_screenshots_drag_scroll_test.js 2024-04-01 17:29:08 +03:00
Niklas Baumgardner
9be70cc492 Bug 1864038 - Add keyboard shortcuts for screenshots overlay. r=sfoster,fluent-reviewers,bolsson,desktop-theme-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D193847
2024-04-01 13:51:16 +00:00
Niklas Baumgardner
c300e0b0c4 Bug 1884936 - Make sure there are no gaps in screenshots canvas. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204367
2024-03-12 19:34:25 +00:00
Niklas Baumgardner
7515009d91 Bug 1884172 - Use x-moz-nativeimage when copying screenshots to clipboard. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204256
2024-03-12 19:03:33 +00:00
Stanca Serban
fe83932e94 Backed out changeset 1e8ffb360c27 (bug 1884172) for causing OSX mochitests failures in browser_screenshots_test_visible.js. CLOSED TREE 2024-03-12 19:10:04 +02:00
Niklas Baumgardner
1993607fe7 Bug 1884172 - Use x-moz-nativeimage when copying screenshots to clipboard. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204256
2024-03-12 14:22:34 +00:00
Sandor Molnar
6b82cd2685 Backed out changeset a24a00e9a529 (bug 1884172) for causing bc failures @ browser/components/screenshots/tests/browser/browser_screenshots_test_full_page.js CLOSED TREE 2024-03-12 01:03:08 +02:00
Niklas Baumgardner
5b22671ddc Bug 1884172 - Use x-moz-nativeimage when copying screenshots to clipboard. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D204256
2024-03-11 16:18:31 +00:00
Niklas Baumgardner
04d3f814c0 Bug 1882925 - Floor coordinates before drawing to canvas in screenshots. r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D203769
2024-03-07 22:55:58 +00:00
Niklas Baumgardner
d918992b35 Bug 1873947 - Fix dragging screenshots tab to new window. r=sfoster,mconley
Differential Revision: https://phabricator.services.mozilla.com/D198470
2024-03-07 13:32:00 +00:00
Sam Foster
e10d714796 Bug 1789727 - Default to the component implementation of Screenshots for nightly builds. r=extension-reviewers,sfoster,robwu,chutten
* Flip the component pref to true by default for nightly builds only
* Move the pref check and initialization to a startup idle task
* And be a bit smarter about when we get and disable the addon
* Fix a bug where we try to communicate with the overlay after the window actor is destroyed when
  the component pref gets flipped off during use

Differential Revision: https://phabricator.services.mozilla.com/D196888
2024-03-04 21:13:17 +00:00
Sandor Molnar
7ec5066cee Backed out changeset 5b88e57227bc (bug 1789727) for causing bc failures @ browser_feature_callout_in_chrome.js & browser_asrouter_toolbarbadge CLOSED TREE 2024-03-01 20:33:14 +02:00
Sam Foster
27c17caceb Bug 1789727 - Default to the component implementation of Screenshots for nightly builds. r=extension-reviewers,sfoster,robwu,chutten
* Flip the component pref to true by default for nightly builds only
* Move the pref check and initialization to a startup idle task
* And be a bit smarter about when we get and disable the addon
* Fix a bug where we try to communicate with the overlay after the window actor is destroyed when
  the component pref gets flipped off during use

Differential Revision: https://phabricator.services.mozilla.com/D196888
2024-03-01 15:02:51 +00:00
Noemi Erli
6b84db45b8 Backed out changeset 9b4da905ce36 (bug 1789727) for causing failures in browser_asrouter_toolbarbadge.js CLOSED TREE 2024-02-29 22:43:51 +02:00
Sam Foster
998fa1d9fe Bug 1789727 - Default to the component implementation of Screenshots for nightly builds. r=extension-reviewers,sfoster,robwu,chutten
* Flip the component pref to true by default for nightly builds only
* Move the pref check and initialization to a startup idle task
* And be a bit smarter about when we get and disable the addon
* Fix a bug where we try to communicate with the overlay after the window actor is destroyed when
  the component pref gets flipped off during use

Differential Revision: https://phabricator.services.mozilla.com/D196888
2024-02-29 18:27:46 +00:00
Sandor Molnar
0941fe84f2 Backed out changeset c8f7d19d58bb (bug 1789727) for causing telemetry/marionette/tests/client/test_subsession_management.py CLOSED TREE 2024-02-28 18:42:48 +02:00
Sam Foster
0b69b3a243 Bug 1789727 - Default to the component implementation of Screenshots for nightly builds. r=extension-reviewers,sfoster,robwu
* Flip the component pref to true by default for nightly builds only
* Move the pref check and initialization to a startup idle task
* And be a bit smarter about when we get and disable the addon
* Fix a bug where we try to communicate with the overlay after the window actor is destroyed when
  the component pref gets flipped off during use

Differential Revision: https://phabricator.services.mozilla.com/D196888
2024-02-28 15:40:08 +00:00
Sam Foster
923aed9c7c Bug 1874154 - Anchor the 'Screenshot copied' notification on the hamburger menu button if the screenshot button isn't available. r=niklas
Differential Revision: https://phabricator.services.mozilla.com/D201143
2024-02-14 20:12:30 +00:00
Niklas Baumgardner
bb40d6b5a8 Bug 1791086 - Select elements within iframes in screenshots. r=sfoster,mconley
Differential Revision: https://phabricator.services.mozilla.com/D195165
2024-02-09 22:02:51 +00:00
Niklas Baumgardner
f37dadc23b Bug 1876779 - Fix issue with last screenshot method. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D199747
2024-01-30 20:05:53 +00:00
Niklas Baumgardner
a145338e1e Bug 1875034 - Round screenshots region before drawSnapshot. r=sfoster
Both the extension and the component were both passing in numbers like 286.6499938964844 but they were behind rounded differently or something?
It seems to me that the extension was flooring the numbers somewhere and the component wasn't flooring or rounding the numbers anywhere.
The two images would start off being the same but then would progressively become more different. See image diff below
{F5955989}

If we round the region before drawing the snapshot the resulting images will match.
Sometimes there is some offset difference (only 1 px difference) because the component now `round`s and I think the extensions `floor`s. `286.6499938964844` would be `286` for the extension and `287` for the component.

Differential Revision: https://phabricator.services.mozilla.com/D199059
2024-01-25 15:27:08 +00:00
Niklas Baumgardner
9b5daf0abd Bug 1867644 - Focus last used button for screenshots UI. r=sfoster
Differential Revision: https://phabricator.services.mozilla.com/D197348
2024-01-19 22:08:30 +00:00