pixivの作品一覧をトリミングせずに表示

pixivのプロフィール画面(ユーザーのイラストやマンガが一覧表示される画面)と、作品画面の下に表示される作者の作品一覧内の作品が、正方形にトリミングされて表示されるのを防止します。

< Feedback on pixivの作品一覧をトリミングせずに表示

Question/comment

§
Posted: 2019-03-01
Edited: 2019-03-02

suggestion

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);

PatriotAuthor
§
Posted: 2019-03-05

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!

PatriotAuthor
§
Posted: 2019-03-07

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

Post reply

Sign in to post a reply.