diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 60278a8f3..09f5c5109 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -65,8 +65,7 @@ var ScreenshotService = class { } *_resolveRelativeFilename(filename) { - if (GLib.str_has_suffix(filename, '.png')) - filename = filename.substr(0, -4); + filename = filename.replace(/\.png$/, ''); let path = [ GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES),