Greasy Fork is available in English.
Allow direct linking to images from Startpage, without a proxy
当前为
// ==UserScript==
// @name Startpage Direct Image URL
// @namespace http://tampermonkey.net/
// @version 3.0
// @description Allow direct linking to images from Startpage, without a proxy
// @author YXXXXNN
// @license GPL
// @match https://startpage.com/sp/search*
// @match https://startpage.com/do/dsearch*
// @match https://www.startpage.com/sp/search*
// @match https://www.startpage.com/do/dsearch*
// @match https://eu.startpage.com/sp/search*
// @match https://eu.startpage.com/do/dsearch*
// @match https://us.startpage.com/sp/search*
// @match https://us.startpage.com/do/dsearch*
// @match https://*.startpage.com/sp/search*
// @match https://*.startpage.com/do/dsearch*
// @icon https://www.startpage.com/sp/cdn/favicons/favicon--default.ico
// @grant none
// ==/UserScript==
window.addEventListener('load', () => {
var a = document.createElement("a");
a.rel = "noopener nofollow noreferrer";
a.target = "_blank";
a.ariaLabel = "link";
a.className = "css-dirimg451";
a.innerHTML = "View direct image";
a.style = "color: #7f869f; font-size: 13px; text-decoration: none; margin-top: 15px;"
document.getElementsByClassName("expanded-details-link")[0].append(a);
}, false);
window.addEventListener('load', function (e) {
var imgbtn = document.getElementsByClassName('image-links')[0].children[0];
var observer = new MutationObserver(function(mutations) {
let url = document.getElementsByClassName('image-links')[0].children[0].href;
url = url.substring(52);
url = url.substring(0, url.indexOf('&'));
url = decodeURIComponent(url);
document.getElementsByClassName('css-dirimg451')[0].href = url;
});
observer.observe(imgbtn, {
attributes: true,
attributeFilter: ['href'] });
imgbtn.dataset.selectContentVal = 1;
}, false);