Windy.com country remover

Removes specific elements from windy.com

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Windy.com country remover
// @namespace    http://tampermonkey.net/
// @version      1.11
// @description  Removes specific elements from windy.com
// @author       UAEpro
// @match        https://*.windy.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to remove elements
    function removeElements() {
        // Remove "open-in-app" element
        const openInApp = document.getElementById('open-in-app');
        if (openInApp) {
            openInApp.remove();
        }

        // Remove marker pane
        const markerPane = document.querySelector('.leaflet-pane.leaflet-marker-pane');
        if (markerPane) {
            markerPane.remove();
        }

        // Remove logo
        const logo = document.getElementById('logo');
        if (logo) {
            logo.remove();
        }
    }

    // Initial removal
    removeElements();

    // Set up a MutationObserver to handle dynamically loaded elements
    const observer = new MutationObserver(function(mutations) {
        removeElements();
    });

    // Start observing the document with the configured parameters
    observer.observe(document.body, {
        childList: true,
        subtree: true
    });
})();