I've written an userscript for geocaching.com which switches the language automatically to a specified language (German), if English was set by an external app.
It worked fine until about 10 days ago, for no reason I could imagine.
If I remove @grant
from the script, it works again, but causes several issues with the rest of the page.
Any @grant
I tried, including none
, breaks the script.
It's still working as it's supposed to do in Chrome. But I've already heard, Tampermonkey and Chrome are a little different than Greasemonkey on Firefox.
Any idea I can give a try is very welcome. Here's the script:
// ==UserScript==
// @name c:geo LangFix Deutsch BETA
// @include https://www.geocaching.com/*/*/*
// @include https://www.geocaching.com/*/*
// @include https://www.geocaching.com/*
// @include https://www.geocaching.com
// @include http://www.geocaching.com/*/*/*
// @include http://www.geocaching.com/*/*
// @include http://www.geocaching.com/*
// @include http://www.geocaching.com
// @exclude http://www.geocaching.com/account/messagecenter
// @exclude https://www.geocaching.com/map/*
// @exclude https://www.geocaching.com/map
// @version 1.2
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant GM_xmlhttpRequest
// ==/UserScript==
var TargetLink = $('a[href*="LocaleList$ctl04$uxLocaleItem"]');
var LanguageSwitch = $("div.LocaleText:contains('Choose Language')");
if (TargetLink.length && LanguageSwitch.length)
window.location.assign (TargetLink[0].href);