Last active
May 5, 2020 04:55
-
-
Save M-rcus/eeb3afcb549987ef9b79a8f953b34bf5 to your computer and use it in GitHub Desktop.
This file contains 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 Twitter Images - New URL Format | |
// @description For better quality images | |
// @namespace https://github.com/M-rcus | |
// @author Marcus H | |
// @match https://pbs.twimg.com/media/* | |
// @grant none | |
// @version 1.1.2 | |
// @updateUrl https://gist.githubusercontent.com/M-rcus/eeb3afcb549987ef9b79a8f953b34bf5/raw | |
// ==/UserScript== | |
const url = new URL(window.location.href); | |
const format = 'png'; | |
const name = '4096x4096'; | |
const params = url.searchParams; | |
if (params.get('format') !== format || params.get('name') !== name) { | |
const path = url.pathname.replace(/\.(jpg|png)((:large)?)$/, ''); | |
window.location.href = url.origin + path + `?format=${format}&name=${name}`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment