Greasy Fork is available in English.

Geocaching Puzzle Solution Hider

Hides the stuff from myster caches

  1. /* global $: true */
  2. /* global waitForKeyElements: true */
  3.  
  4. // ==UserScript==
  5. // @name Geocaching Puzzle Solution Hider
  6. // @description Hides the stuff from myster caches
  7. // @match http://www.geocaching.com/geocache/*
  8. // @match https://www.geocaching.com/geocache/*
  9. // @match http://geocaching.com/geocache/*
  10. // @match https://geocaching.com/geocache/*
  11. // @match http://www.geocaching.com/play/*
  12. // @match https://www.geocaching.com/play/*
  13. // @match http://geocaching.com/play/*
  14. // @match https://geocaching.com/play/*
  15. // @match http://www.geocaching.com/plan/*
  16. // @match https://www.geocaching.com/plan/*
  17. // @match http://geocaching.com/plan/*
  18. // @match https://geocaching.com/plan/*
  19. // @match https://www.certitudes.org/*
  20. // @match http://www.certitudes.org/*
  21. // @version 1.2
  22. // @namespace https://greatest.deepsurf.us/en/scripts/529637-geocaching-puzzle-solution-hider/code
  23. // @homepage https://greatest.deepsurf.us/en/scripts/529637-geocaching-puzzle-solution-hider/code
  24. // @require https://greatest.deepsurf.us/scripts/383527-wait-for-key-elements/code/Wait_for_key_elements.js?version=701631
  25. // @license MIT
  26. // ==/UserScript==
  27.  
  28. (function() {
  29. 'use strict';
  30. function hideFirstElementWithClassX(abc) {
  31. // Find the first element with class name 'xxx'
  32. var element = document.querySelector(abc);
  33.  
  34. // Check if the element exists
  35. if (element) {
  36. // Hide the element by setting its display style to none
  37. element.style.display = 'none';
  38. }
  39. }
  40. function setDistanceToZero(abc) {
  41. // Select all elements with the class 'distance-cell'
  42. var elements = document.getElementsByClassName(abc);
  43.  
  44. // Iterate through the selected elements and set their inner text
  45. for (var i = 0; i < elements.length; i++) {
  46. elements[i].innerText = '0.0 mi';
  47. }
  48. }
  49.  
  50.  
  51.  
  52. // Call the function to set the distances
  53. setDistanceToZero('distance-cell');
  54. setDistanceToZero('list-geocache-distance');
  55.  
  56.  
  57.  
  58. // Call the function to hide the element
  59. // hideFirstElementWithClassX(".Note.PersonalCacheNote");
  60. hideFirstElementWithClassX(".LocationData.FloatContainer");
  61. hideFirstElementWithClassX("#coordinate-div");
  62. // hideFirstElementWithClassX("#uxlrgMap");
  63. hideFirstElementWithClassX("#solution");
  64. hideFirstElementWithClassX("#viewCacheNote");
  65. hideFirstElementWithClassX("#map_canvas");
  66. })();