// ==UserScript== // @name 京东只选自营 // @description 检测京东输入关键词,自动添加自营 // @namespace https://greasyfork.org/zh-CN/scripts/369241 // @version 0.2 // @author lqzh // @copyright lqzh // @include http*://search.jd.com/Search?keyword=* // @grant none // @downloadURL none // ==/UserScript== (function() { 'use strict'; var key = getUrlParam('keyword'); if (!key.includes("自营")){ window.location.href= "https://search.jd.com/Search?keyword=" +key +"%20自营" + "&enc=utf-8"; } function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r != null) { return decodeURI(r[2]); } return null; } })();