// ==UserScript== // @name Startpage Direct Image URL // @namespace http://tampermonkey.net/ // @version 2.0 // @description Allow direct linking to images from Startpage, without a proxy // @author YXXXXNN // @license GPL // @match http*://*.startpage.com/* // @match https://startpage.com/sp/search* // @match https://www.startpage.com/sp/search* // @match https://eu.startpage.com/sp/search* // @match https://us.startpage.com/sp/search* // @match https://*.startpage.com/sp/search* // @match https://startpage.com/do/dsearch* // @match https://www.startpage.com/do/dsearch* // @match https://eu.startpage.com/do/dsearch* // @match https://us.startpage.com/do/dsearch* // @match https://*.startpage.com/do/dsearch* // @match https://startpage.com/do/search* // @match https://www.startpage.com/do/search* // @match https://eu.startpage.com/do/search* // @match https://us.startpage.com/do/search* // @match https://*.startpage.com/do/search* // @icon https://www.google.com/s2/favicons?domain=startpage.com // @grant none // @require http://code.jquery.com/jquery-3.4.1.min.js // @downloadURL none // ==/UserScript== // Add direct image link to image search const directImgLink = function() { 'use strict'; $(".expanded-details-link").append(` View direct image `); }; window.addEventListener('load', directImgLink, false); // Update URL on link update var imgbtn = document.getElementsByClassName('css-dhfft7')[0]; var observer = new MutationObserver(function(mutations) { let url = $(".css-dhfft7").attr("href"); url = url.substring(52); url = url.substring(0, url.indexOf('&')); url = decodeURIComponent(url); $(".css-dirimg451").attr("href", url); }); observer.observe(imgbtn, { attributes: true, attributeFilter: ['href'] }); imgbtn.dataset.selectContentVal = 1;