Bug 1744779 Comment 10 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I think was the important bit: 
```
diff --git a/browser/extensions/screenshots/build/shot.js b/browser/extensions/screenshots/build/shot.js
--- a/browser/extensions/screenshots/build/shot.js
+++ b/browser/extensions/screenshots/build/shot.js
@@ -383,7 +383,7 @@ this.shot = (function() {
       const filenameDate = currentDateTime.substring(0, 10);
       const filenameTime = currentDateTime.substring(11, 19).replace(/:/g, "-");
       let clipFilename = `Screenshot ${filenameDate} at ${filenameTime} ${filenameTitle}`;
-      const clipFilenameBytesSize = clipFilename.length * 2; // JS STrings are UTF-16
+      const clipFilenameBytesSize = new Blob([clipFilename]).size; // Max size needs to be bytes not chars
       if (clipFilenameBytesSize > 251) {
         // 255 bytes (Usual filesystems max) - 4 for the ".png" file extension string
         const excedingchars = (clipFilenameBytesSize - 246) / 2; // 251 - 5 for ellipsis "[...]"
```
I think this was the important bit: 
```
diff --git a/browser/extensions/screenshots/build/shot.js b/browser/extensions/screenshots/build/shot.js
--- a/browser/extensions/screenshots/build/shot.js
+++ b/browser/extensions/screenshots/build/shot.js
@@ -383,7 +383,7 @@ this.shot = (function() {
       const filenameDate = currentDateTime.substring(0, 10);
       const filenameTime = currentDateTime.substring(11, 19).replace(/:/g, "-");
       let clipFilename = `Screenshot ${filenameDate} at ${filenameTime} ${filenameTitle}`;
-      const clipFilenameBytesSize = clipFilename.length * 2; // JS STrings are UTF-16
+      const clipFilenameBytesSize = new Blob([clipFilename]).size; // Max size needs to be bytes not chars
       if (clipFilenameBytesSize > 251) {
         // 255 bytes (Usual filesystems max) - 4 for the ".png" file extension string
         const excedingchars = (clipFilenameBytesSize - 246) / 2; // 251 - 5 for ellipsis "[...]"
```

Back to Bug 1744779 Comment 10