// ==UserScript== // @name gwdang精简版 // @namespace none // @version 1.1 // @description gwdang精简版 ,精简gwdang,减少弹窗,仅留下顶栏,并去除菜单部分 // @author 淘宝老司机 // @require https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js // @include http*://item.taobao.com/* // @include http*://detail.tmall.com/item.htm* // @include http*://chaoshi.detail.tmall.com/item.htm* // @include http*://item.jd.com/* // @grant GM_xmlhttpRequest // @connect chenzelin.herokuapp.com // @downloadURL none // ==/UserScript== host = 'chenzelin.herokuapp.com'; function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } function AutoStart(time, cssSelector, dealFunc) { var timerNode = setInterval(function () { try{ if (document.querySelector(cssSelector) != null){ clearInterval(timerNode); dealFunc(); } }catch (e){} }, time); } function JudgeDelay(time, judgeFunc, dealFunc) { var timerNode = setInterval(function () { try{ if (judgeFunc){ clearInterval(timerNode); dealFunc(); } }catch (e){} }, time); } function n_tm_card(_id, title, price, pic_url, coupon_info){ var li = document.createElement('li'); var div = document.createElement('div'); li.appendChild(div); div.className = 'img'; div.style="width: 70%; margin: 5px; border-bottom: black"; var a = document.createElement('a'); a.href="javaScript:void(0)"; a.onclick = function(){n_item_click(_id);}; div.appendChild(a); var img = document.createElement('img'); a.appendChild(img); img.style="width: 100%;height: 100%; padding: 5px;"; img.title=title; img.alt=title; img.src=pic_url; var b = document.createElement('a'); b.onclick = function(){n_item_click(_id);}; div.appendChild(b); b.style="padding: 5px; width: 100%; font-weight: bold; color: blue; display: flex; justify-content: center"; b.innerText = price; if(coupon_info != 'NULL'){ b.innerText +='|' + coupon_info; } return li; } function n_item_click(_id){ GM_xmlhttpRequest({ method: "GET", responseType: 'jsonp', url: "http://" + host + "/api/tb/id?id=" + _id, onload: function(resp) { try{ var tks = $.parseJSON(resp.responseText); var item_url = tks[0]; var item_coupon = tks[1]; if (item_coupon.indexOf('taobao.com') > 0){ var a = document.createElement('a'); a.href=item_coupon; a.click(); } else if (item_url.indexOf('taobao.com') > 0){ var a = document.createElement('a'); a.href=item_url; a.click(); } }catch(e) { } } }); } function n_tm_init(){ var get_name = 'get.js'; var get_ext = 'f=/js/gwdang_extension.js'; var get_host = 'https://browser.gwdang.com/'; var s = document.createElement('script'); s.setAttribute('src', get_host + get_name + '?' + get_ext); document.body.appendChild(s); } function n_tm_init_sc(){ var tp = document.querySelector('#gwdang_main > a'); tp.style.display ='none'; tp = document.querySelector('#gwdang-feed-close'); tp.style.display ='none'; tp = document.querySelector('#gwdang-history'); tp.style.display ='none'; } function n_item_load_sc(item){ try{ var _id = item.dataset['id']; var chs = item.children; for(j=0;j setTimeout(resolve, time)); } function n_tm_load(){ nav = document.querySelector('#gwdang-main'); var hid_span = document.querySelector('#ald-skuRight > div > div.ald-hd > span'); hid_span.innerText = ""; var hack = document.querySelector("#ald-skuRight"); var dv = document.createElement('ul'); hack.insertBefore(dv, hack.children[0]); var i; AutoStart(1000, "#tmall-item-list", function () { var items = nav.querySelector('#tmall-item-list').children; for(i=0;i div > div.tuijian-bd.tb-clearfix > ul'); }catch(e){ } var i; AutoStart(4000, "#tmall-item-list", function () { var items = nav.querySelector('#tmall-item-list').children; try{ for(i=0;i 0){ }else if(location.host == 'detail.tmall.com'){ AutoStart(5000, ".tb-detail-hd, .tb-main-title", function () { goodID = getQueryString("id"); }); AutoStart(5000, "#ald-skuRight > div > div.ald-hd > span", function () { AutoStart(1000, '#gwdang-main', function () { n_tm_load(); }); }); } else if (location.host == 'item.taobao.com') { AutoStart(5000, ".tb-detail-hd, .tb-main-title", function () { goodID = getQueryString("id"); }); AutoStart(5000, "#gwdang-main", function () { n_tb_load(); }); }