CSS: windy.com

Corrections to UI of windy.com

当前为 2025-04-27 提交的版本,查看 最新版本

// ==UserScript==
// @name          CSS: windy.com
// @description   Corrections to UI of windy.com
// @author        MK
// @namespace     max44
// @homepage      https://greasyfork.org/en/users/309172-max44
// @match         *://*.windy.com/*
// @icon          https://www.google.com/s2/favicons?sz=64&domain=windy.com
// @version       1.0
// @license       MIT
// ==/UserScript==

(function() {
    'use strict';

  //Workaround: This document requires 'TrustedHTML' assignment
  if (window.trustedTypes && trustedTypes.createPolicy) {
    if (!trustedTypes.defaultPolicy) {
      const passThroughFn = (x) => x;
      trustedTypes.createPolicy('default', {
        createHTML: passThroughFn,
        createScriptURL: passThroughFn,
        createScript: passThroughFn,
      });
    }
  }

  var css = `
  /*Hide go premium button*/
  #desktop-premium-icon {
    display: none !important;
  }

  /*Hide premium map selectors*/
  .map-selector a.clickable:has(.premium-flag) {
    display: none !important;
  }

  /*Hide premium features*/
  .data-table .extended,
  #detail-box-desktop > div:has(.premium-flag) {
    display: none !important;
  }

  /*Hide watermark*/
  .premium-calendar #map-container::after {
    background-image: none !important;
  }
  `;

  if (typeof GM_addStyle != 'undefined') {
    GM_addStyle(css);
  } else if (typeof PRO_addStyle != 'undefined') {
    PRO_addStyle(css);
  } else if (typeof addStyle != 'undefined') {
    addStyle(css);
  } else {
    var node = document.createElement('style');
    node.type = 'text/css';
    node.appendChild(document.createTextNode(css));
    document.documentElement.appendChild(node);
  }
})();