您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
12/05/2025, 14.16.58
// ==UserScript== // @name Widescreen Full page width dba.dk // @namespace Violentmonkey Scripts // @match https://www.dba.dk/* // @grant none // @license GNU AGPLv3 // @version 1.0 // @author stewil // @description 12/05/2025, 14.16.58 // ==/UserScript== //remove top banner document.getElementsByClassName("banners")[0].remove(); const main = document.getElementsByTagName("main")[0]; main.style.maxWidth = "100%"; const grid = main.getElementsByClassName("grid")[0]; // decrease sidebar width fraction grid.classList.remove("grid-cols-3"); grid.classList.add("grid-cols-4"); grid.children[1].classList.remove("col-span-2"); grid.children[1].classList.add("col-span-3"); const article_grid = grid.children[1].getElementsByClassName("grid")[0] function correct_size(image) { image.sizes = "(min-width: 2800) 960px, (min-width: 1900px) 640px, " + image.sizes; // allow loading a larger thumbnails image.parentElement.classList.remove("aspect-3/4"); // remove annoying vertical image cut. // alt set aspect ratios if desired, these will crop the images! //image.parentElement.classList.add("aspect-1/1"); //image.parentElement.classList.add("aspect-16/9"); image.parentElement.classList.add("aspect-3/2"); //image.parentElement.classList.add("aspect-4/3"); } var images = grid.getElementsByTagName("img"); for (const image of images) { correct_size(image); } // articles without image have the "picture" element var pictures = grid.getElementsByTagName("picture"); for (const picture of pictures) { correct_size(picture); } const callback = (records, observer) => { for (const record of records) { let images = record.target.getElementsByTagName("img"); for (const image of images) { correct_size(image); } var pictures = grid.getElementsByTagName("picture"); for (const picture of pictures) { correct_size(picture); } } }; const observer = new MutationObserver(callback); const config = { childList: true, subtree: true }; // fix images when filtering renews search observer.observe(article_grid, config);