Created
February 5, 2017 17:25
-
-
Save sorz/caedd1320a81d9cffaa2998d5cac4759 to your computer and use it in GitHub Desktop.
Change "normal" size avatar pictures to "bigger" size on Tweetdeck.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name HD Avatar for Tweetdeck | |
// @namespace org.sorz.lab.tweetdeck | |
// @include https://tweetdeck.twitter.com/ | |
// @version 0.1 | |
// @grant none | |
// @require https://cdn.rawgit.com/jpillora/xhook/1.3.5/dist/xhook.min.js | |
// ==/UserScript== | |
const REGEX_AVATAR_URL = /(\/profile_images\\\/\d+\\\/[\w-]+_)(normal)(\.)/g | |
const NEW_SIZE = 'bigger'; | |
xhook.after((request, response) => { | |
if (request.url.match(/\/\w+\.json/)) { | |
response.text = response.text.replace(REGEX_AVATAR_URL, `$1${NEW_SIZE}$3`); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment