您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Move priceGraph below listings
当前为
// ==UserScript== // @name Tweakers PriceGraph Mover // @namespace http://tampermonkey.net/ // @version 1.1 // @description Move priceGraph below listings // @author Markisoke // @match https://tweakers.net/pricewatch/* // @license MIT // ==/UserScript== (function() { 'use strict'; function moveAndResize() { const priceGraph = document.querySelector('.priceGraph'); const listing = document.getElementById('listing'); const reference = document.querySelector('.top-banner.hideInGradeXS.loading.reserveSpace'); if (priceGraph && listing && reference) { // Move priceGraph after listing if (listing.nextSibling !== priceGraph) { listing.parentNode.insertBefore(priceGraph, listing.nextSibling); } // Match width const refWidth = window.getComputedStyle(reference).width; [listing, priceGraph].forEach(el => { el.style.width = refWidth; el.style.maxWidth = refWidth; el.style.margin = '0 auto'; el.style.boxSizing = 'border-box'; }); const listingTable = listing.querySelector('table'); if (listingTable) { listingTable.style.width = '100%'; listingTable.style.tableLayout = 'auto'; } } } // Observe for dynamic content const observer = new MutationObserver(() => { const listing = document.getElementById('listing'); const priceGraph = document.querySelector('.priceGraph'); const reference = document.querySelector('.top-banner.hideInGradeXS.loading.reserveSpace'); if (listing && priceGraph && reference) { moveAndResize(); observer.disconnect(); } }); observer.observe(document.body, { childList: true, subtree: true }); // Also run after full DOM load window.addEventListener('load', moveAndResize); })();