您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Shopify小助手(仅在变体页面注入样式)
// ==UserScript== // @name BSQ-Shopify小助手 // @namespace http://tampermonkey.net/ // @version 2025-08-27 // @description Shopify小助手(仅在变体页面注入样式) // @author You // @match https://admin.shopify.com/store/huanuo-shop-new/* // @icon https://www.google.com/s2/favicons?sz=64&domain=shopify.com // @grant GM_addStyle // @license MIT // ==/UserScript== (function() { 'use strict'; let styleTagId = "bsq-shopify-style"; function addStyle() { if (!document.getElementById(styleTagId)) { const style = document.createElement("style"); style.id = styleTagId; style.textContent = ` .Polaris-Labelled--hidden span.Polaris-Thumbnail { width:100px !important; height: 100px !important; } .Polaris-Labelled--hidden button[class^="_imageContainer"] { width:100px !important; height: 100px !important; } div[class^="_PositionedOverlay"]{ top: 100px !important; } div[class^="_PositionedOverlay"] div[class^="_CardPopover-show"]{ max-height: 80vh !important; } `; document.head.appendChild(style); console.log("✅ BSQ 样式已注入"); } } function removeStyle() { const style = document.getElementById(styleTagId); if (style) { style.remove(); console.log("❌ BSQ 样式已移除"); } } function checkPage() { if (location.pathname.includes("/products/") && location.pathname.includes("/variants/")) { addStyle(); } else { removeStyle(); } } // 初次加载检查 checkPage(); // 监听 SPA 导航变化 if (window.navigation) { window.navigation.addEventListener("navigate", () => { setTimeout(checkPage, 300); }); } else { // 回退方案(兼容性更广) window.addEventListener("popstate", checkPage); window.addEventListener("pushState", checkPage); window.addEventListener("replaceState", checkPage); } })();