GoodSoul

NWZ – einspaltig: rechte Spalte weg, volle Breite

Nov 12th, 2026
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. // ==UserScript==
  2. // @name NWZ – einspaltig: rechte Spalte weg, volle Breite
  3. // @namespace https://www.nwzonline.de/
  4. // @version 1.1
  5. // @description Entfernt die rechte Spalte auf Übersichtsseiten (Prospekte & Co.) und Artikelseiten ("Mehr aus …") und gibt dem Inhalt die volle Breite.
  6. // @match https://www.nwzonline.de/*
  7. // @run-at document-start
  8. // @noframes
  9. // @grant GM_addStyle
  10. // ==/UserScript==
  11.  
  12. (function () {
  13. 'use strict';
  14.  
  15. // "Mehr aus …" auf Artikelseiten: false = entfernen, true = unter den Artikel verschieben
  16. const MEHR_AUS_UNTEN = false;
  17.  
  18. GM_addStyle(`
  19. /* ===== Übersichtsseiten ===== */
  20. [class*="RightRailWrapperstyled__RightRailWrapper"] { display: none !important; }
  21. [class*="RightRailWrapperstyled__RightRail-"] { display: block !important; }
  22. [class*="RightRailWrapperstyled__RightRail-"] > div {
  23. width: 100% !important; max-width: 100% !important;
  24. margin-left: 0 !important; flex: none !important;
  25. }
  26.  
  27. /* ===== Artikelseiten ===== */
  28. /* Rechte Spalte (348px: "Mehr aus …", Widgets, Werbung) ausblenden */
  29. [class*="ContentMainRightRailstyled__RightRail"] { display: none !important; }
  30.  
  31. /* Artikelbereich auf volle Kartenbreite statt calc(100% - 348px) */
  32. [class*="ContentMainRightRailstyled__ContentMain-"] {
  33. width: 100% !important;
  34. max-width: 100% !important;
  35. padding-right: var(--inline-spacing-article, 24px) !important;
  36. }
  37.  
  38. /* 596px-Zentrierung im Artikel aufheben – Inhalt füllt die Box */
  39. [class*="ContentMainRightRailstyled__ContentMainRightRail"] [class*="CenteredContentWrapper"] {
  40. max-width: none !important;
  41. width: 100% !important;
  42. margin-left: 0 !important;
  43. margin-right: 0 !important;
  44. } `);
  45.  
  46. if (MEHR_AUS_UNTEN) {
  47. const place = () => {
  48. const rail = document.querySelector('[class*="ContentMainRightRailstyled__RightRail"]');
  49. const card = document.querySelector('[class*="ContentMainRightRailstyled__ContentMainRightRail"]');
  50. if (!rail || !card) return;
  51. for (const chain of rail.querySelectorAll('[class*="ChainContainerstyled__ChainContainer"]')) {
  52. const h = chain.querySelector('h2, h3, h4');
  53. if (h && /^Mehr aus/.test(h.textContent.trim())) { card.after(chain); break; }
  54. }
  55. };
  56. document.addEventListener('DOMContentLoaded', place);
  57. // Fusion lädt Inhalte nach – ggf. erneut verschieben (idempotent, kein Loop)
  58. new MutationObserver(place).observe(document.documentElement, { childList: true, subtree: true });
  59. }
  60. })();
Advertisement