Greasy Fork镜像 支持简体中文。

Clean wetter.com

Hide unrelated elements, auto load updates

// ==UserScript==
// @name        Clean wetter.com
// @description Hide unrelated elements, auto load updates
// @namespace   shiftgeist
// @match       https://www.wetter.com/*
// @grant       GM_addStyle
// @version     20250226.2
// @author      shiftgeist
// @license     GNU GPLv3
// @icon        https://cs3.wettercomassets.com/wcomv5/images/icons/favicon/48x48.png
// ==/UserScript==

GM_addStyle(`
nav,
aside,
footer,
#weather-headline,
#current-weather-with-content .thumbnail-container,
#nowcast,
#outstream-outer,
#wetter,
#current-weather-with-content #snow-link,
#furtherDetails,
#ski-area-link,
#livecam,
#globalText,
#pictureNewsWithRightText,
#video-teaser-fixed,
#seo-link-list,
.werbung,
.social-grid,
.warnings-grid,
.city-weather-grid,
.cityweather h2,
.cityweather h3,
.cityweather p,
.page-gradient,
.header-login,
.swg-col-arrow,
.info-grid,
.scroll,
[data-tb-region="inlineVideoBox"],
[data-module="forecast-layout1-additional"],
[data-for="climate"],
[data-template="columnsWidget"],
[data-tb-region="aufmachermodul"],
[data-template="startpageWidget"],
[data-contenttype="hd-live-webcams"],
[data-text="Rückblick"] {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
}

#cnt-with-location-attributes .rtw_weather_txt.text--small {
  font-size: 1rem !important;
}

.desk-two-thirds,
.homepagemapmodule .c1,
.mia-map-container {
  width: unset !important;
  max-width: unset !important;
}

#header-placeholder,
.mia-map-container,
.homepagemapmodule,
.cityweather {
  height: auto !important;
  min-height: auto !important;
}

.forecast-navigation-move,
.bg--blue-gradient,
.forecast-navigation-grid a:not(.is-active):not(:hover),
.forecast-navigation-line a.is-active,
.forecast-navigation-line a:hover {
  background: #3769b6 !important;
}

.forecast-navigation-grid a.is-active,
.forecast-navigation-grid a:hover {
  background: #fff !important;
}

#current-weather-with-content {
  margin: -20px -20px 0;
}

@media only screen and (max-width: 600px) {
  #current-weather-with-content {
    margin: -30px -40px 0;
  }
}

.forecast-navigation-move {
  border-radius: 0 0 4px 4px;
  padding: 10px 10px 6px 10px;
}

.bottom-border--grey {
  border: none !important;
}

.sun-moon .sun {
  font-size: 18px;
}

.spaces-weather-grid .swg-row-wrapper {
  grid-template-columns: unset !important;
}

#cnt-with-location-attributes.flex-gap {
  gap: unset;
}

#cnt-with-location-attributes .lap-pr- {
  padding-right: 0 !important;
}
`);

setInterval(() => {
  const hasUpdate = document.querySelector('#newRefresh .btn');

  if (hasUpdate.offsetParent) {
    hasUpdate.click();
  }
}, 5000);

const selectors = [
  ['div.app-layout', 'News zum Thema Wetter'],
  ['div.app-layout', 'Wetter-News'],
  ['div.app-layout', 'Wetter live in Deutschland'],
  ['div.app-layout', 'Webvideos aus aller Welt'],
  ['div.app-layout', 'Wetter Deutschland'],
  ['div.app-layout', 'Die nächsten Wetterstationen'],
  ['div.app-layout', 'Einen anderen Ort auswählen'],
  ['div.app-layout', 'Das könnte dich auch interessieren'],
  ['div.app-layout', 'Details zur Wetterkarte Regenradar für Deutschland'],
  ['div.app-layout', 'Tipps für die Wahl des richtigen Lichtschutzfaktors'],
  ['div.c2', 'Mehr zum Wetter'],
  ['.layout__item', 'Aktuelle Videos für das Wetter in Deutschland'],
  ['.layout__item', 'Unwetterwarnungen'],
  ['.layout__item', '3-Tage-Wetter'],
  ['.pt--', 'Standort'],
  ['div', 'Die HD-Kamera zeigt das Wetter live am Standort'],
];

selectors.forEach(([select, text]) => {
  const parents = Array.from(document.querySelectorAll(select));
  const parentF = parents.filter(p => p.innerText.toLowerCase().trim().startsWith(text.toLowerCase()));
  parentF.forEach(p => {
    p.style.display = 'none';
  });
  console.log(`[clean] Removed ${parentF.length} elements.`)
})

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址