Local Geekmarket

Browse BoardGameGeek market pages in your local currency

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Local Geekmarket
// @namespace    net.cheyne
// @version      1.02
// @description  Browse BoardGameGeek market pages in your local currency
// @author       Iain Cheyne
// @match        https://boardgamegeek.com/market*
// @exclude      https://boardgamegeek.com/market/account*
// @exclude      https://boardgamegeek.com/market/product*
// @exclude      https://boardgamegeek.com/market/user*
// @exclude      https://boardgamegeek.com/market/dashboard*
// @exclude      https://boardgamegeek.com/market/sell*
// @grant        none
// @license      CC0-1.0
// ==/UserScript==

(function() {
  'use strict';

  const currentUrl = new URL(window.location.href);
  const currencyParam = 'currency';
  const desiredCurrency = 'GBP';

  // Check if the currency parameter is already set to the desired currency
  if (currentUrl.searchParams.get(currencyParam) !== desiredCurrency) {
    // Set or update the currency parameter to the desired currency
    currentUrl.searchParams.set(currencyParam, desiredCurrency);

    // Replace the current URL with the modified one
    window.location.replace(currentUrl.href);
  }
})();