Created
April 14, 2024 02:13
-
-
Save mehunk/554760ac58c0b7fef634c9fd4ea3ad9f to your computer and use it in GitHub Desktop.
Tampermonkey Script - Redirect to Google Map Japan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Redirect to Google Map Japan | |
// @namespace http://tampermonkey.net/ | |
// @version 2024-04-14 | |
// @description redirect to Google Map Japan whatever the language is set | |
// @author mehunk | |
// @match https://www.google.com/maps/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const LANG_PROP = 'hl' | |
const TARGET_LANG = 'ja' | |
const url = new URL(document.URL) | |
const lang = url.searchParams.get(LANG_PROP) | |
if (lang === TARGET_LANG) { | |
return | |
} | |
url.searchParams.set(LANG_PROP, TARGET_LANG) | |
document.location.href = url.toString() | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment