High resolution images for tweetdeck

Make tweetdeck content be loaded to highest resolution possible

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         High resolution images for tweetdeck
// @namespace    http://tampermonkey.net/
// @version      0.2
// @icon         https://tweetdeck.twitter.com/favicon.ico
// @description  Make tweetdeck content be loaded to highest resolution possible
// @author       mmorgat
// @match        https://tweetdeck.twitter.com/*
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
    /* document.getElementsByClassName('stream-item'); */
    function loadHighRes(){
        let images = document.getElementsByClassName('js-media-image-link');
        for(let image of images){
            if(image.classList.contains('block') && image.classList.contains('media-item') && image.classList.contains('med-link')){
                //Replace the URL of the image so that twitter loads the best resolution possible
                image.style.backgroundImage = image.style.backgroundImage.replace('name=360x360', 'name=large');
                image.style.backgroundImage = image.style.backgroundImage.replace('name=medium', 'name=large');
                image.style.backgroundImage = image.style.backgroundImage.replace('name=small', 'name=large');
            }
        }
    }
    setInterval(function(){loadHighRes();},500); //Changes all images to higher res version every 0.5 seconds
})();