# HG changeset patch # User nanaya # Date 1562798238 -32400 # Node ID f03e2d169a8a20fb4bbfd5d5cb6a3a9557cad92d # Parent 444b17e657be9ffb00c47f3a67c86ea415ed6cbe Only delete format if there's extension in filename diff -r 444b17e657be -r f03e2d169a8a tweetdeck-large-image.user.js --- a/tweetdeck-large-image.user.js Wed Jul 10 22:36:31 2019 +0900 +++ b/tweetdeck-large-image.user.js Thu Jul 11 07:37:18 2019 +0900 @@ -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 }