Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name BlueSky Profile Override
- // @namespace http://tampermonkey.net/
- // @version 2024-09-05
- // @description Override accounts' profile pictures and display names.
- // @author @isofrieze.art
- // @match http*://bsky.app/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=bsky.app
- // @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
- // @grant none
- // ==/UserScript==
- // accounts to modify
- let data = [
- {
- "account": "account.bsky.social", // the account handle to override
- "newPfp": "https://example.com/img/icon.png", // url to new profile picture
- "newName": "New Name" // new name
- },
- {
- "account": "account2.bsky.social", // must define account handle
- // if you leave out newPfp, the profile picture is just hidden
- // if you leave out the newName, the name turns into webdings
- }
- ];
- ///////////////////////////////
- // dont change anything below this unless you know what you're doing
- ///////////////////////////////
- let textReplace = [];
- (function() {
- 'use strict';
- $("html").append("<style id='accountoverride' type='text/css'></style>");
- for (let p of data) {
- if (p.newPfp) {
- $("#accountoverride").append("a[href$=\"" + p.account + "\"] div[style*=\"background-image: url\"] { background-image: url('" + p.newPfp + "') !important; }");
- $("#accountoverride").append("div[aria-label$=\"" + p.account + "'s avatar\"] div[style*=\"background-image: url\"] { background-image: url('" + p.newPfp + "') !important; }");
- } else {
- $("#accountoverride").append("a[href$=\"" + p.account + "\"] div[style*=\"background-image: url\"] { background-image: none !important; }");
- $("#accountoverride").append("div[aria-label$=\"" + p.account + "'s avatar\"] div[style*=\"background-image: url\"] { background-image: none !important; }");
- }
- if (p.newName) {
- textReplace.push(p);
- } else {
- $("#accountoverride").append("a[href^=\"/profile/" + p.account + "\"][style*=\"font-weight: 700\"] { font-family: Webdings !important; }");
- $("#accountoverride").append("div:has(button[aria-label*=\"similar to " + p.account + "\"]) + div div[data-testid=\"profileHeaderDisplayName\"] { font-family: Webdings !important; }");
- }
- }
- setInterval(function() {
- for (let p of textReplace) {
- $("a[href^=\"/profile/" + p.account + "\"][style*=\"font-weight: 700\"]").html(p.newName);
- $("div:has(button[aria-label*=\"similar to " + p.account + "\"]) + div div[data-testid=\"profileHeaderDisplayName\"]").html(p.newName);
- $("div[data-testid*=\"" + p.account + "\"] a[href*=\"" + p.account + "\"]:not(:has(*)").html(p.newName);
- }
- }, 200);
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement