Hide Street View Road Names

Useful for guessr style games

// ==UserScript==
// @name        Hide Street View Road Names
// @namespace   Violentmonkey Scripts
// @match       *://www.google.com/maps/embed/v1/streetview*
// @match       *://openguessr.com/*
// @grant       none
// @version     1.3
// @author      Evan Boehs
// @description Useful for guessr style games
// @license     MIT
// @resource    script https://maps.gstatic.com/maps-api-v3/embed/js/60/2/init_embed.js
// @grant       GM_getResourceText
// ==/UserScript==

(function () {
  const targetScript = "init_embed.js";
  // Attempt to prevent original script from loading
  if (typeof Element !== "undefined" && Element.prototype) {
    const originalAppChild = Element.prototype.appendChild;
    Element.prototype.appendChild = function () {
      if (arguments[0].src && arguments[0].src.includes(targetScript)) {
        return arguments[0];
      }
      return originalAppChild.apply(this, arguments);
    };
  }

  const embedPreload = document.querySelector(`link[href*="${targetScript}"]`);

  if (embedPreload) {
    embedPreload.parentNode.removeChild(embedPreload);

    const modifiedScript = GM_getResourceText("script").replace(
      '};b.dir="";',
      '};b.dir="";a.showRoadLabels=false;console.log("Successful Hijack");'
    );
    window.addEventListener("load", function () {
      const int = setInterval(() => {
        if (!window.google) {
          console.warn('window.google not defined despite load event.')
        }
        const newScript = document.createElement("script");
        newScript.textContent = modifiedScript;
        document.body.appendChild(newScript);
        clearInterval(int)
      },50)
    });
  }
})();

QingJ © 2025

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