Sortowanie Allegro

Skrypt automatycznie zmienia sortowanie na: cena z dostawą: od najniższej

当前为 2020-02-12 提交的版本,查看 最新版本

// ==UserScript==
// @name         Sortowanie Allegro
// @namespace    http://allegro.pl
// @version      1.1
// @description  Skrypt automatycznie zmienia sortowanie na: cena z dostawą: od najniższej
// @author       DD7
// @match        *://allegro.pl/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

const category = 'order=d',
	  url = window.location.toString();

if((url.includes('listing') && !url.includes(category)) || (url.includes('kategoria') && !url.includes(category))) {
	if(url.includes('order=')) {
		return;
	}

	if(!url.includes('?')) {
	   	window.location += `?&${category}`;
		return;
	}

	window.location += `&${category}`;
}