suggestion

About: pixivの作品一覧をトリミングせずに表示
redigerte March 2019 i Script Discussions [?]

you can use

let elementClassName=`[width="184"] [style^='background-image: url("https://i.pximg.net/c/']`;

instead of let elementClassName="*constantly changing class*";

i also made some more changes:

// @grant        GM_addStyle
// ==/UserScript==
'use strict';

GM_addStyle(`[width="184"] [style^='background-image: url("https://i.pximg.net/c/'] { background-size: contain !important; }`);

setInterval(function(){
    let array = document.querySelectorAll(`[width="184"] [style^='background-image: url("https://i.pximg.net/c/']:not(.changed)`);
    for (let i = array.length; i--;) {
        array[i].style.backgroundImage = array[i].style.backgroundImage.replace(/\d{3}x\d{3}_.+?\//, '240x240/').replace('square1200', 'master1200');
        array[i].classList.add('changed');
    }
}, 500);

Kommentarer

  • Your suggestion looks very nice.👍 I'll test your script for something problems. If there is no problems, I'll merge your script into this script and will write your name on Credits with special thank. Thank you!

  • Your suggestion has merged. You can see it in the script page.

Logg inn eller Registrer deg for å kommentere.