CSS: windy.com

Corrections to UI of windy.com

目前為 2025-04-27 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name CSS: windy.com
  3. // @description Corrections to UI of windy.com
  4. // @author MK
  5. // @namespace max44
  6. // @homepage https://greasyfork.org/en/users/309172-max44
  7. // @match *://*.windy.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=windy.com
  9. // @version 1.0
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. //Workaround: This document requires 'TrustedHTML' assignment
  17. if (window.trustedTypes && trustedTypes.createPolicy) {
  18. if (!trustedTypes.defaultPolicy) {
  19. const passThroughFn = (x) => x;
  20. trustedTypes.createPolicy('default', {
  21. createHTML: passThroughFn,
  22. createScriptURL: passThroughFn,
  23. createScript: passThroughFn,
  24. });
  25. }
  26. }
  27.  
  28. var css = `
  29. /*Hide go premium button*/
  30. #desktop-premium-icon {
  31. display: none !important;
  32. }
  33.  
  34. /*Hide premium map selectors*/
  35. .map-selector a.clickable:has(.premium-flag) {
  36. display: none !important;
  37. }
  38.  
  39. /*Hide premium features*/
  40. .data-table .extended,
  41. #detail-box-desktop > div:has(.premium-flag) {
  42. display: none !important;
  43. }
  44.  
  45. /*Hide watermark*/
  46. .premium-calendar #map-container::after {
  47. background-image: none !important;
  48. }
  49. `;
  50.  
  51. if (typeof GM_addStyle != 'undefined') {
  52. GM_addStyle(css);
  53. } else if (typeof PRO_addStyle != 'undefined') {
  54. PRO_addStyle(css);
  55. } else if (typeof addStyle != 'undefined') {
  56. addStyle(css);
  57. } else {
  58. var node = document.createElement('style');
  59. node.type = 'text/css';
  60. node.appendChild(document.createTextNode(css));
  61. document.documentElement.appendChild(node);
  62. }
  63. })();