返回首頁 

Greasy Fork is available in English.

BSKY Replace Thumbnail with Full Res Image

Replace downsized thumbnails with full resolution images

// ==UserScript==// @name         BSKY Replace Thumbnail with Full Res Image// @namespace    http://tampermonkey.net/// @version      0.1// @description  Replace downsized thumbnails with full resolution images// @author       minnie// @match        *://*.bsky.app/*// @grant        none// @license      MIT// ==/UserScript==(function() {'use strict';//replace thumbnails with full-res imagesfunction replaceThumbnails() {// Select all thumbnail imageslet thumbnails = document.querySelectorAll('img[src*="feed_thumbnail"]');// Loop through the thumbnail imagesthumbnails.forEach(function(thumb) {// Replace 'feed_thumbnail' with 'feed_fullsize' in the src URLlet fullR###rl = thumb.src.replace('feed_thumbnail', 'feed_fullsize');// Set the new full resolution URL to the src attributethumb.src = fullR###rl;});}replaceThumbnails();// Create a MutationObserver to watch for dynamically added thumbnailsconst observer = new MutationObserver(function(mutations) {mutations.forEach(function(mutation) {if (mutation.addedNodes.length > 0) {// Check each added nodemutation.addedNodes.forEach(function(node) {if (node.nodeType === 1 && node.querySelectorAll) {let newThumbnails = node.querySelectorAll('img[src*="feed_thumbnail"]');if (newThumbnails.length > 0) {// Replace thumbnails for newly added nodesreplaceThumbnails();}}});}});});observer.observe(document.body, {childList: true,subtree: true});})();