自动京东配送

在京东浏览商品时,可选择自动为你勾选 [京东配送]、[仅显示有货]、[销量排序]。方便实用!

目前为 2016-03-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         自动京东配送
// @namespace    http://hzy.pw
// @description  在京东浏览商品时,可选择自动为你勾选 [京东配送]、[仅显示有货]、[销量排序]。方便实用!
// @authuer      Moshel
// @homepageURL  http://hzy.pw/p/1349
// @supportURL   http://weibo.com/moshel
// @icon         http://hzy.pw/wp-content/uploads/2015/04/i.jpeg

// @include      http://list.jd.com/*
// @include      http://search.jd.com/*
// @grant        none
// @run-at       document_start

// @version      2.2.2
// ==/UserScript==


! function() {
    "use strict";

    var href = location.search;

    if (href.indexOf("delivery") < 0)
        href += "&delivery=1";
    if (href.indexOf("stock") < 0)
        href += "&stock=1";
    /* 图书页面的京东配送 */
    if (href.indexOf("wtype") < 0)
        href += "&wtype=1";
    /* 销量排序 */
    if (href.indexOf("psort") < 0)
        href += "&psort=3";

    if(location.search != href)
        location.search = href;

}();