您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
replace image links on olx and otomoto with full quality links
// ==UserScript== // @name olx otomoto image quality fix // @version 2024-05-09 // @description replace image links on olx and otomoto with full quality links // @license MIT // @author liime // @match https://www.otomoto.pl/* // @match https://www.olx.pl/* // @grant none // @namespace https://greasyfork.org/users/1375709 // ==/UserScript== (function(){ function waitForElm(selector) { return new Promise(resolve => { /* if (document.querySelectorAll(selector)) { return resolve(document.querySelectorAll(selector)); } */ const observer = new MutationObserver(mutations => { if (document.querySelectorAll(selector)) { //observer.disconnect(); resolve(document.querySelectorAll(selector)); } }); // If you get "parameter 1 is not of type 'Node'" error, see https://stackoverflow.com/a/77855838/492336 observer.observe(document.body, { childList: true, subtree: true }); }); }; const upsize = function(imgconts) { 'use strict'; console.log(imgconts); for (let img of imgconts) { try { let upscaled = img.src.replace(/s\=\d+x\d+/g, "s=0x0"); let upscaledset = img.srcset.replace(/s\=\d+x\d+/g, "s=0x0"); if (upscaled != img.src) { img.setAttribute("src", upscaled); console.log(img.src); } if (upscaledset != img.srcset) { img.setAttribute("srcset", upscaledset); console.log(img.srcset); } console.log("bullshit"); } catch (e) { console.error(e); console.error(img); } } }; (async function() { while (true) { let imgcontainers = await waitForElm('.embla__slide img, .swiper-slide img'); upsize(imgcontainers); } })() })()