-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocalshop.user.js
27 lines (23 loc) · 1.07 KB
/
localshop.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==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);
}