| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- // ==UserScript==
- // @name Flickr: link direct to "All Sizes"
- // @namespace http://tampermonkey.net/
- // @version 2024-12-17
- // @description try to take over the world!
- // @author You
- // @match https://flickr.com/photos/*/
- // @match https://flickr.com/photos/*/page*
- // @match https://flickr.com/photos/*/with/*
- // @match https://flickr.com/photos/*/albums/*
- // @match https://flickr.com/photos/*/albums/*/page*
- // @match https://flickr.com/photos/*/albums/*/with/*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=flickr.com
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- (function monitorUpdateLinks() {
- let parent = document.querySelector('#content');
- let lastNumberProcessed = 0;
- let observer = new MutationObserver(m => {
- let links = parent.querySelectorAll('a[href^="/photos"]');
- if (links.length == lastNumberProcessed) return;
- Array.from(links).forEach(a => {
- a.href = updateLink(a.href);
- });
- });
- observer.observe(parent, {
- subtree: true,
- childList: true,
- attributes: true,
- });
- function updateLink(url) {
- if (url.match(/(3k|comments|page.*)$/))
- return url;
- let parts = url.match(/\/photos\/[^/]+\/[0-9]+/);
- if (!parts)
- return url;
- console.log('Updating url:', url);
- return `${parts[0]}/sizes/3k`
- }
- })();
- })();
|