Greasy Fork 还支持 简体中文。

Hide Street View Road Names

Useful for guessr style games

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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)
    });
  }
})();