// ==UserScript== // @name 购物党比价工具【精简优化版】 // @namespace none // @version 2.2 // @description 【精简版】购物党,优化了页面的部分元素,减少页面弹窗和显示,保留菜单栏。购物党提供淘宝/京东/亚马逊/当当/苏宁/等百家商城的比价系统,能让你以较优惠的方式购买到你称心如意的商品,提供商品的历史价格情况,多种相似商品推荐,同款购买,降价提醒。PS:带有推广,介意勿装 // @author AC // @antifeature referral-link 含有返利链接 // @include http*://item.taobao.com/* // @include http*://cart.taobao.com/* // @include http*://s.taobao.com/* // @include http*://detail.tmall.com/item.htm* // @include http*://detail.liangxinyao.com/item.htm* // @include http*://chaoshi.detail.tmall.com/item.htm* // @include http*://item.jd.com/* // @include https://item.jd.hk/* // @include https://detail.tmall.hk/* // @include https://*.suning.com/* // @note V2.2 修复可用性 & 替换地址 // @note V1.6 更换源地址为StaticFile // @note V1.4 更换源地址为75团地址 // @note V1.2 修复部分多余的隐藏无效的问题 修复之前忘了【新增自己的附加脚本 如果介意的可以删除本脚本】【新增自己的附加脚本 如果介意的可以删除本脚本】【新增自己的附加脚本 如果介意的可以删除本脚本】 // @grant GM_xmlhttpRequest // @connect open.lesiclub.cn // @connect api.ntaow.com // @connect gwdang.com // @connect alicdn.com // @run-at document-start // @license GPL-3.0-only // @require https://greasyfork.org/scripts/34606-ac-%E7%8B%AC%E5%AE%B6-%E6%B7%98%E5%AE%9D%E5%A4%A9%E7%8C%AB%E4%BC%98%E6%83%A0%E5%88%B8%E6%9F%A5%E8%AF%A2%E9%A2%86%E5%8F%96-%E5%A4%A7%E9%A2%9D%E4%BC%98%E6%83%A0%E5%88%B8-100%E5%85%83%E8%B4%AD%E7%89%A9%E7%A5%9E%E5%88%B8-%E7%9C%81%E9%92%B1%E8%B4%AD%E7%89%A9-%E9%A2%86%E5%88%B8%E8%B4%AD%E4%B9%B0%E6%9B%B4%E4%BC%98%E6%83%A0-%E5%B9%B3%E5%9D%87%E4%BC%98%E6%83%A020/code/AC-%E7%8B%AC%E5%AE%B6-%E6%B7%98%E5%AE%9D%E5%A4%A9%E7%8C%AB%E4%BC%98%E6%83%A0%E5%88%B8%E6%9F%A5%E8%AF%A2%E9%A2%86%E5%8F%96,%E5%A4%A7%E9%A2%9D%E4%BC%98%E6%83%A0%E5%88%B8,%E3%80%90100%E5%85%83%E8%B4%AD%E7%89%A9%E7%A5%9E%E5%88%B8%E3%80%91,%E7%9C%81%E9%92%B1%E8%B4%AD%E7%89%A9,%E9%A2%86%E5%88%B8%E8%B4%AD%E4%B9%B0%E6%9B%B4%E4%BC%98%E6%83%A0,%E5%B9%B3%E5%9D%87%E4%BC%98%E6%83%A020%25.user.js // @downloadURL https://update.greasyfork.icu/scripts/532889/%E8%B4%AD%E7%89%A9%E5%85%9A%E6%AF%94%E4%BB%B7%E5%B7%A5%E5%85%B7%E3%80%90%E7%B2%BE%E7%AE%80%E4%BC%98%E5%8C%96%E7%89%88%E3%80%91.user.js // @updateURL https://update.greasyfork.icu/scripts/532889/%E8%B4%AD%E7%89%A9%E5%85%9A%E6%AF%94%E4%BB%B7%E5%B7%A5%E5%85%B7%E3%80%90%E7%B2%BE%E7%AE%80%E4%BC%98%E5%8C%96%E7%89%88%E3%80%91.meta.js // ==/UserScript== (function () { const goodId = getUrlAttribute("id") // 提取url中的参数 function getUrlAttribute(attribute, needDecode) { const searchValue = (window.location.search.substr(1) + "").split("&"); for (let i = 0; i < searchValue.length; i++) { const key_value = searchValue[i].split("="); const reg = new RegExp("^" + attribute + "$"); if (reg.test(key_value[0])) { const searchWords = key_value[1]; return needDecode ? decodeURIComponent(searchWords) : searchWords; } } } function safeWaitFunc(selector, callbackFunc, time, notClear) { time = time || 200; notClear = notClear || false; const doClear = !notClear; const id = setInterval(function () { let selectRes = document.querySelectorAll(selector); if ((typeof (selector) == "string" && selectRes.length > 0)) { if (doClear) clearInterval(id); if (selectRes.length === 1) selectRes = selectRes[0]; callbackFunc(selectRes); } else if ((typeof (selector) == "function" && selector().length > 0)) { if (doClear) clearInterval(id); callbackFunc(selector()[0]); } }, time); } function addStyle(css) { //添加CSS的代码--copy的--注意里面必须是双引号 var pi = document.createProcessingInstruction( 'xml-stylesheet', 'type="text/css" href="data:text/css;utf-8,' + encodeURIComponent(css) + '"' ); return document.insertBefore(pi, document.documentElement); } function addScript(src) { let node = document.createElement("script"); node.src = src; node.charset = "UTF-8"; document.head.appendChild(node); } function initGWD() { let extName = "gwdv1.js"; let hideStyle = ""; if (location.host === "jd.com") { extName = "gwdv2.js"; hideStyle = ".gwd-minibar-bg, #favor_box{display:none !important;}" + "#gwdang_main > a.gwd-topbar-logo, #gwdang_main > div.gwd-topbar-right{display:none !important;}"; } else { hideStyle = "#gwdang-main>div.logo, #gwdang-feed-close, #gwdang-history, #coupon_box, #bjd_yifenqian_detail{display:none !important}" + "#favor_box{display:none !important;}#tb-amount .tb-count{font-weight:bold;margin:0 5px;}"; } // addScript("https://cdn.jsdelivr.net/gh/chenzelin01/wechatproxy/public/" + extName); addScript("https://browser.gwdang.com/get.js?f=/js/gwdang_extension.js"); addStyle(hideStyle); } function realTimeShowTBTitle(){ addStyle(".tshop-psm-shop-header,.ac-tophide{position: absolute;top: -500px;}.ac-topshow{position:relative;transition: all 1s cubic-bezier(0.4, 0, 1, 1);transform: translateY(500px);}"); let timer = setInterval(function(){ let node = document.querySelector(".tshop-psm-shop-header"); let addClassName = "ac-tophide"; if(node == null) return; // 如果大于200,说明样式未加载 if(node.offsetHeight > 200 && !node.classList.contains(addClassName)){ node.classList.add(addClassName); } if(node.offsetHeight <= 200){ if(node.classList.contains(addClassName)){ node.classList.add("ac-topshow"); clearInterval(timer); }else{ clearInterval(timer); // 清空附加样式 addStyle(".tshop-psm-shop-header{position: relative;top: unset;}"); } } },150); } function init() { function dealRes(json){ var allHide = ""; var yearHide = ""; var monthHide = ""; if (json.store[0].all_line == null) { allHide = "style='display: none;'"; } if (json.store[0].year_line == null) { yearHide = "style='display: none;'"; } if (json.store[0].month_line == null) { monthHide = "style='display: none;'"; } var ddata; if (json.store.length > 1) { ddata = json.store[1].all_line; } var ddata; if (json.store.length > 1) { ddata = json.store[1].all_line; } let pdata = json.store[0].all_line; let pbeginTime = json.store[0].all_line_begin_time; let picdata = ddata; var hml = "