Skip to content

Instantly share code, notes, and snippets.

@Tarrgon
Created October 20, 2024 15:04
Show Gist options
  • Select an option

  • Save Tarrgon/a58375cd3c1f15d8fd4238a2a7df35b5 to your computer and use it in GitHub Desktop.

Select an option

Save Tarrgon/a58375cd3c1f15d8fd4238a2a7df35b5 to your computer and use it in GitHub Desktop.
// ==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