Only delete format if there's extension in filename
1 files changed, 4 insertions(+), 2 deletions(-)

M tweetdeck-large-image.user.js
M tweetdeck-large-image.user.js +4 -2
@@ 1,7 1,7 @@ 
 // ==UserScript==
 // @name         Tweetdeck large image
 // @namespace    https://myconan.net
-// @version      2.0.5.1
+// @version      2.0.6
 // @description  No more stupid link for images in tweetdeck
 // @author       nanaya
 // @match        https://tweetdeck.twitter.com/*

          
@@ 59,7 59,9 @@ 
     if (parsedUrl.searchParams.get('name') == null) {
       url = url.replace(/(\..+:).+/, '$1orig')
     } else {
-      parsedUrl.searchParams.delete('format')
+      if (parsedUrl.pathname.match(/\.[^.]+$/) !== null) {
+        parsedUrl.searchParams.delete('format')
+      }
       parsedUrl.searchParams.set('name', 'orig')
       url = parsedUrl.href
     }