您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Manager like/unlike for artworks with a reset option in the menu
// ==UserScript== // @name Pixiv like/unlike manager // @namespace http://tampermonkey.net/ // @version 2.7 // @description Manager like/unlike for artworks with a reset option in the menu // @icon https://s.pximg.net/www/js/build/89b113d671067311.svg // @match https://www.pixiv.net/* // @grant GM_registerMenuCommand // @license CC BY-NC-ND 4.0 // ==/UserScript== (function () { "use strict"; const defaultLeft = "20px"; const defaultTop = "800px"; // Add a "Reset to default" option in the Violentmonkey menu GM_registerMenuCommand("Reset to default", () => { localStorage.removeItem("popupLeft"); localStorage.removeItem("popupTop"); alert("Popup position has been reset to default."); location.reload(); // Reload the page to apply changes }); // Create popup const popupLeft = localStorage.getItem("popupLeft") || defaultLeft; const popupTop = localStorage.getItem("popupTop") || defaultTop; const popup = document.createElement("div"); popup.style.position = "fixed"; popup.style.top = popupTop; popup.style.left = popupLeft; popup.style.backgroundColor = "rgb(51, 51, 51)"; popup.style.border = "1px solid #ccc"; popup.style.borderRadius = "5px"; popup.style.padding = "15px"; popup.style.boxShadow = "0 2px 10px rgba(0, 0, 0, 0.2)"; popup.style.zIndex = "1000"; popup.style.opacity = "0.5"; popup.style.width = "200px"; popup.style.cursor = "move"; popup.style.pointerEvents = "auto"; popup.style.display = "flex"; // Flexbox để căn chỉnh popup.style.flexDirection = "column"; // Xếp chồng các phần tử popup.style.alignItems = "center"; // Căn giữa theo chiều ngang popup.style.gap = "10px"; // Khoảng cách giữa các phần tử let isDragging = false; popup.onmousedown = function (event) { isDragging = true; event.preventDefault(); let shiftX = event.pageX - popup.offsetLeft; let shiftY = event.pageY - popup.offsetTop; function moveAt(pageX, pageY) { popup.style.left = pageX - shiftX + "px"; popup.style.top = pageY - shiftY + "px"; } function onMouseMove(event) { moveAt(event.pageX, event.pageY); localStorage.setItem("popupLeft", popup.style.left); localStorage.setItem("popupTop", popup.style.top); } document.addEventListener("mousemove", onMouseMove); document.onmouseup = function () { isDragging = false; document.removeEventListener("mousemove", onMouseMove); localStorage.setItem("popupLeft", popup.style.left); localStorage.setItem("popupTop", popup.style.top); document.onmouseup = null; }; popup.onmouseup = function () { isDragging = false; }; }; popup.ondragstart = function () { return false; }; // Create buttons and message area const likeButton = document.createElement("button"); likeButton.innerText = "Like"; likeButton.style.cursor = "pointer"; likeButton.style.backgroundColor = "#28a745"; likeButton.style.color = "white"; likeButton.style.border = "none"; likeButton.style.borderRadius = "5px"; likeButton.style.padding = "10px"; likeButton.style.width = "100%"; const unlikedButton = document.createElement("button"); unlikedButton.innerText = "Unlike"; unlikedButton.style.cursor = "pointer"; unlikedButton.style.backgroundColor = "#dc3545"; unlikedButton.style.color = "white"; unlikedButton.style.border = "none"; unlikedButton.style.borderRadius = "5px"; unlikedButton.style.padding = "10px"; unlikedButton.style.width = "100%"; const pixivButton = document.createElement("img"); pixivButton.src = "https://s.pximg.net/www/js/build/89b113d671067311.svg"; pixivButton.alt = "pixiv"; pixivButton.style.width = "82px"; pixivButton.style.height = "32px"; pixivButton.style.cursor = "pointer"; pixivButton.onclick = function () { window.location.href = "https://www.pixiv.net"; }; const message = document.createElement("div"); message.style.marginTop = "10px"; message.style.color = "white"; message.style.fontWeight = "bold"; message.style.textAlign = "center"; // Append buttons to the popup popup.appendChild(likeButton); popup.appendChild(unlikedButton); popup.appendChild(pixivButton); popup.appendChild(message); document.body.appendChild(popup); // Like button functionality likeButton.onclick = function () { handleAction("like", "gAARvC", "Liked"); }; // Unlike button functionality unlikedButton.onclick = function () { handleAction("unlike", "wQCIS", "Unliked"); }; function handleAction(action, svgClass, actionText) { const buttons = document.querySelectorAll("button.sc-e48c39c9-0"); let actionCount = 0; let totalButtons = 0; message.innerText = "Scanning..."; buttons.forEach((button) => { const svg = button.querySelector("svg"); if (svg && svg.classList.contains(svgClass)) { totalButtons++; } }); if (totalButtons === 0) { message.innerText = `All artworks ${actionText.toLowerCase()}ed`; return; } else { message.innerText = `Total ${totalButtons} artworks to ${action}`; } buttons.forEach((button) => { const svg = button.querySelector("svg"); if (svg && svg.classList.contains(svgClass)) { const randomDelay = Math.random() * 900 + 100; setTimeout(() => { button.click(); actionCount++; message.innerText = `${actionText} ${actionCount}/${totalButtons} artworks`; }, randomDelay); } }); } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址