screenshots icon indicating copy to clipboard operation
screenshots copied to clipboard

"Index or size negative or greater than allowed amount" error is displayed if the "Copy" or "Download" button is clicked for a zero-area selection

Open SoftVision-CosminMuntean opened this issue 6 years ago • 2 comments

[Affected versions]:

  • Nightly 61.0a1
  • Beta 60.0b15

[Affected Platforms]:

  • All Windows
  • All Mac
  • All Linux

[Prerequisites]:

  • Have a clean Firefox profile and the Screenshots Onboarding tour already visited.

[Steps to reproduce]:

  1. Open Firefox browser and navigate to any website.
  2. Click the "Page actions" menu and select the "Take a Screenshot" option.
  3. Perform a selection that have zero-width or zero-height.
  4. Click the "Copy" or "Download" button and observe the behavior.

[Expected result]:

  • "Your selection is too small" error is displayed and the overlay is not dismissed.

[Actual result]:

  • "Index or size negative or greater than allowed amount" error is displayed and the overlay is dismissed until you click again on the page.

[Notes]:

  • We had a similar issue logged for for the "Save" button in #2957.

  • On the latest Firefox 59.0.2 release a different message error is displayed: "BackgroundError: Error: Data is not a valid png image".

  • Here is a screenshot wit browser console error: zero area selection

  • Here is a screen recording with the issue: zero-area selection

Sentry: https://sentry.prod.mozaws.net/operations/screenshots-addon-dev/issues/4287898/

Asa also reported this error message in the Screenshots Slack channel. But he was trying to take a shot of a tweet on Twitter, so I don't know if it's the same root cause.

chenba avatar Apr 26 '18 14:04 chenba

Let's set the minimum size of X or Y >0px

ghost avatar Apr 30 '18 15:04 ghost