Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name NWZ – einspaltig: rechte Spalte weg, volle Breite
- // @namespace https://www.nwzonline.de/
- // @version 1.1
- // @description Entfernt die rechte Spalte auf Übersichtsseiten (Prospekte & Co.) und Artikelseiten ("Mehr aus …") und gibt dem Inhalt die volle Breite.
- // @match https://www.nwzonline.de/*
- // @run-at document-start
- // @noframes
- // @grant GM_addStyle
- // ==/UserScript==
- (function () {
- 'use strict';
- // "Mehr aus …" auf Artikelseiten: false = entfernen, true = unter den Artikel verschieben
- const MEHR_AUS_UNTEN = false;
- GM_addStyle(`
- /* ===== Übersichtsseiten ===== */
- [class*="RightRailWrapperstyled__RightRailWrapper"] { display: none !important; }
- [class*="RightRailWrapperstyled__RightRail-"] { display: block !important; }
- [class*="RightRailWrapperstyled__RightRail-"] > div {
- width: 100% !important; max-width: 100% !important;
- margin-left: 0 !important; flex: none !important;
- }
- /* ===== Artikelseiten ===== */
- /* Rechte Spalte (348px: "Mehr aus …", Widgets, Werbung) ausblenden */
- [class*="ContentMainRightRailstyled__RightRail"] { display: none !important; }
- /* Artikelbereich auf volle Kartenbreite statt calc(100% - 348px) */
- [class*="ContentMainRightRailstyled__ContentMain-"] {
- width: 100% !important;
- max-width: 100% !important;
- padding-right: var(--inline-spacing-article, 24px) !important;
- }
- /* 596px-Zentrierung im Artikel aufheben – Inhalt füllt die Box */
- [class*="ContentMainRightRailstyled__ContentMainRightRail"] [class*="CenteredContentWrapper"] {
- max-width: none !important;
- width: 100% !important;
- margin-left: 0 !important;
- margin-right: 0 !important;
- } `);
- if (MEHR_AUS_UNTEN) {
- const place = () => {
- const rail = document.querySelector('[class*="ContentMainRightRailstyled__RightRail"]');
- const card = document.querySelector('[class*="ContentMainRightRailstyled__ContentMainRightRail"]');
- if (!rail || !card) return;
- for (const chain of rail.querySelectorAll('[class*="ChainContainerstyled__ChainContainer"]')) {
- const h = chain.querySelector('h2, h3, h4');
- if (h && /^Mehr aus/.test(h.textContent.trim())) { card.after(chain); break; }
- }
- };
- document.addEventListener('DOMContentLoaded', place);
- // Fusion lädt Inhalte nach – ggf. erneut verschieben (idempotent, kein Loop)
- new MutationObserver(place).observe(document.documentElement, { childList: true, subtree: true });
- }
- })();
Advertisement