Skip to content

Instantly share code, notes, and snippets.

@mehunk
Created April 14, 2024 02:13
Show Gist options
  • Save mehunk/554760ac58c0b7fef634c9fd4ea3ad9f to your computer and use it in GitHub Desktop.
Save mehunk/554760ac58c0b7fef634c9fd4ea3ad9f to your computer and use it in GitHub Desktop.
Tampermonkey Script - Redirect to Google Map Japan
// ==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