comparison tweetdeck-large-image.user.js @ 64:6715e53ad0bf

Oh whoops missing var
author nanaya <me@nanaya.pro>
date Wed, 10 Jul 2019 22:27:45 +0900
parents 53d0f935ecb8
children 444b17e657be
comparison
equal deleted inserted replaced
63:53d0f935ecb8 64:6715e53ad0bf
1 // ==UserScript== 1 // ==UserScript==
2 // @name Tweetdeck large image 2 // @name Tweetdeck large image
3 // @namespace https://myconan.net 3 // @namespace https://myconan.net
4 // @version 2.0.5 4 // @version 2.0.5.1
5 // @description No more stupid link for images in tweetdeck 5 // @description No more stupid link for images in tweetdeck
6 // @author nanaya 6 // @author nanaya
7 // @match https://tweetdeck.twitter.com/* 7 // @match https://tweetdeck.twitter.com/*
8 // @grant none 8 // @grant none
9 // @downloadURL https://bitbucket.org/nanayapro/ec-userscripts/raw/tip/tweetdeck-large-image.user.js 9 // @downloadURL https://bitbucket.org/nanayapro/ec-userscripts/raw/tip/tweetdeck-large-image.user.js
52 url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)\1\)$/, "$2"); 52 url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)\1\)$/, "$2");
53 } else { 53 } else {
54 url = image.src; 54 url = image.src;
55 } 55 }
56 56
57 parsedUrl = new URL(url); 57 var parsedUrl = new URL(url);
58 58
59 if (parsedUrl.searchParams.get('name') == null) { 59 if (parsedUrl.searchParams.get('name') == null) {
60 url = url.replace(/(\..+:).+/, "$1orig"); 60 url = url.replace(/(\..+:).+/, "$1orig");
61 } else { 61 } else {
62 parsedUrl.searchParams.delete('format'); 62 parsedUrl.searchParams.delete('format');