自动京东配送

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

  1. // ==UserScript==
  2. // @name 自动京东配送
  3. // @name:zh-CN 自动京东配送
  4. // @name:zh-TW 自動京東配送
  5. // @description 在京东浏览商品时,可选择自动为你勾选 [京东配送]、[仅显示有货]、[销量排序]。方便实用!
  6. // @description:zh-CN 在京东浏览商品时,可选择自动为你勾选 [京东配送]、[仅显示有货]、[销量排序]。方便实用!
  7. // @description:zh-TW 在京東瀏覽商品時,可選擇自動為你勾選 [京東配送]、[僅顯示有貨]、[銷量排序]。方便實用!
  8.  
  9. // @author Moshel
  10. // @namespace https://hzy.pw
  11. // @homepageURL https://hzy.pw/p/1349
  12. // @supportURL https://github.com/h2y/link-fix
  13. // @icon https://hzy.pw/wp-content/uploads/2015/04/i.jpeg
  14. // @license GPL-3.0
  15.  
  16. // @include *//search.jd.com/*
  17. // @include *//www.jd.com/pinpai/*
  18. // @include *//list.jd.com/list.html?*
  19. // @grant none
  20. // @run-at document-start
  21.  
  22. // @version 2.4.0
  23. // @modified 02/07/2018
  24. // ==/UserScript==
  25.  
  26.  
  27. ! function() {
  28.  
  29. // get GET attributes
  30. const $_GET = (function(){
  31. let url = location.search;
  32. let u = url.split("?", 2);
  33. if(typeof(u[1]) === "string"){
  34. u = u[1].split("&");
  35. let get = {};
  36. for(let i=0; i<u.length; i++) {
  37. let j = u[i].split("=");
  38. get[j[0]] = j[1];
  39. }
  40. return get;
  41. }
  42. else
  43. return {};
  44. })();
  45.  
  46.  
  47. let href = location.search;
  48.  
  49.  
  50. //搜索自营
  51. if ($_GET.keyword &&
  52. decodeURIComponent($_GET.keyword).indexOf('自营')<0 &&
  53. !window.sessionStorage['auto_jd_changed_keyword'] )
  54. {
  55. href = href.replace($_GET.keyword, $_GET.keyword + ' 自营' );
  56. window.sessionStorage['auto_jd_changed_keyword'] = true;
  57. }
  58.  
  59.  
  60. // 有货
  61. if (!$_GET.stock)
  62. href += "&stock=1";
  63. // 京东配送
  64. if (!$_GET.wtype)
  65. href += "&wtype=1";
  66. // 销量排序
  67. if (!$_GET.psort)
  68. href += "&psort=3";
  69. /*某些分类页面*/
  70. if(!$_GET.sort)
  71. href += "&sort=sort_totalsales15_desc";
  72.  
  73.  
  74. if(location.search != href)
  75. location.search = href;
  76.  
  77. }();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址