Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ==UserScript==
// @name AutoMujiSort
// @namespace http://www.milk1000.cc/
// @include http://www.muji.net/store/cmdty/section/*
// ==/UserScript==
(function() {
var OLD_PATTERN = { sort: 4, count: 12 };
var NEW_PATTERN = { sort: 0, count: 150 };
var $ = function(selector) { return document.querySelector(selector); };
if ($('select[name="sort"]') && $('select[name="sort"]').value == OLD_PATTERN.sort &&
$('select[name="count"]') && $('select[name="count"]').value == OLD_PATTERN.count) {
$('select[name="sort"]').value = NEW_PATTERN.sort;
$('select[name="count"]').value = NEW_PATTERN.count;
(typeof unsafeWindow != 'undefined' ? unsafeWindow : window).sort();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.