Created
October 20, 2024 15:04
-
-
Save Tarrgon/a58375cd3c1f15d8fd4238a2a7df35b5 to your computer and use it in GitHub Desktop.
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 BSky Redirect | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2024-05-26 | |
| // @description Redirect you to the best version available from bluesky | |
| // @author You | |
| // @match https://cdn.bsky.app/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=bsky.app | |
| // @grant none | |
| // ==/UserScript== | |
| (async function () { | |
| 'use strict'; | |
| let url = window.location.pathname.split("/") | |
| if (url.length < 6) return | |
| let did = url[4] | |
| let cid = url[5].slice(0, url[5].lastIndexOf("@")) | |
| if (did && cid) { | |
| window.location.href = `https://bsky.social/xrpc/com.atproto.sync.getBlob?did=${did}&cid=${cid}` | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment