This is a Local Shop for Local People

A simple script to reload eBay UK listing pages to only show you results from eBay UK.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        This is a Local Shop for Local People
// @namespace   Violentmonkey Scripts
// @match       https://www.ebay.co.uk/sch/i.html
// @grant       none
// @version     1.0
// @author      madra.net
// @license     GNU GPLv3
// @description A simple script to reload eBay UK listing pages to only show you results from eBay UK.
// Annoyingly, no matter how many times you select "UK Only"  eBay defaults to showing international
// listings each time you search. This script will reload the search listing result page and append the
// appropriate parameter to the URL to show onky UK results. Obviously only tested with eBay UK. Should
// be trivial enough to adapt to your own local eBay.
// ==/UserScript==

/* -- Store current URL */
var oldURL  = window.location;

/*--- Test if local results only parameter is in current URL. ie "&LH_PrefLoc=1" */
if ( ! /&LH_PrefLoc=1/.test (oldURL) ) {

    /*-- if not, append it */
    var newURL  = window.location+ "&LH_PrefLoc=1";
    
    /*-- and reload window with updated URL. */
    window.location.replace (newURL);
}