Bobby's Pixiv Utils

Compatible with mobile. "Edit bookmark" and "Toggle bookmarked" buttons, publish dates conversion, block AI-generated works, block by Pixiv tags, UTags integration, and more!

< Bobby's Pixiv Utils 피드백으로 돌아가기

리뷰: 좋음 - 스크립트가 잘 작동함

§
게시: 2025-04-04

Block artist on mobile

Since mobile layout doesn't display artist name, utags doesn't run.

First we have to make a script to display artist:

// ==UserScript==
// @name        Pixiv add user id to /tags
// @namespace   Violentmonkey Scripts
// @match       https://www.pixiv.net/tags/*
// @grant       none
// @version     1.0
// @author      -
// @description 4/4/2025, 4:41:39 PM
// @inject-into page
// @require     https://raw.githack.com/kubetail-org/sentineljs/refs/heads/master/dist/sentinel.min.js
// ==/UserScript==

{
  sentinel.on(".works-item-illust:not(:has(a[href*=users])):has(.thumb:not([src^=data]))", el => {
    const userId = el.__vue__._props.item.user_id;
    const a = document.createElement("a");
    a.href = `https://www.pixiv.net/users/${userId}`;
    a.textContent = el.__vue__._props.item.author_details.user_name;
    el.append(a);
  });
}

Then, we have to extend the SELECTORS_IMAGE variable of Bobby's Pixiv Utils by editing the script storage, so it can detect images on mobile:

{
  "SELECTORS_IMAGE": ".works-item-illust"
}
§
게시: 2025-04-04

BTW in Tampermonkey, the storage is not editable unless a value has been set: https://stackoverflow.com/questions/56918239/where-is-tampermonkeys-storage-tab-to-edit-the-storage-content

It might be a good idea to write some initial values after installation.

BobbyWibowo작성자
§
게시: 2025-04-05
수정: 2025-04-05

Thanks for the feedback!

Once I have the spare time, I'll look into better support of the mobile site with the next release (it was indeed never tested there). Thanks for the codes excerpts too.

In the meantime, v1.4.7 will now pre-populate its storage with default values for better Tampermonkey support.

BobbyWibowo작성자
§
게시: 2025-04-06

As of v1.5.1, blocking artists on mobile is now built into the script 👍

Also, I switched to using sentineljs for everything while I was at it, it's pretty neat

답글 게시

답글을 게시하려면 로그인하세요.

长期地址
遇到问题?请前往 GitHub 提 Issues。