code
javascript: (function() { function qr(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return r[2]; return null; } var site = window.location.href.match(/^http(s)?:\/\/ [^?]*/); var collocationId = qr("collocationId");// tc var sellerId = qr("sellerId"); var userId = qr("userId"); var activity_id = qr("activity_id");// yhq var seller_id = qr("seller_id");// yhq var id = qr("id"); if (collocationId != null ) { var pureUrl = ' http://h5.m.taobao.com/cm/collocation.html?id= ' + collocationId + '&userId=' + sellerId; } else if (id != null && userId != null) { var pureUrl = ' http://h5.m.taobao.com/cm/collocation.html?id= ' + id + '&userId=' + userId; }else if (id != null) { var pureUrl = site[0] + "?id=" + id; } else if (activity_id != null && seller_id != null) { var pureUrl = ' https://market.m.taobao.com/apps/aliyx/coupon/detail.html?activity_id= '+ activity_id + '&seller_id=' + seller_id; } else { Alert ('This script is only used on Taobao details page/package page/coupon page '); } Var reload=prompt ("optimized version link:", pureUrl); if (reload != null) { window.location.href = pureUrl; } })();
javascript:(function(){function a(a){a=new RegExp("(^|&)"+a+"=([^&]*)(&|$)","i");a=window.location.search.substr(1).match(a); return null!=a?a[2]:null}var g=window.location.href.match(/^http(s)?:\/\/ [^?]*/),d=a("collocationId"),h=a("sellerId"),e=a("userId"),f=a("activity_id"),k=a("seller_id"),c=a("id"); if(null!= d)var b=" http://h5.m.taobao.com/cm/collocation.html?id= "+d+"&userId="+h;else null!=c&&null!=e?b=" http://h5.m.taobao.com/cm/collocation.html?id= "+c+"&userId="+e:null!=c?b=g[0]+"?id="+c:null!= f?b=" https://market.m.taobao.com/apps/aliyx/coupon/detail.html?activity_id= "+f+"&seller_id="+k:alert("\u672c\u811a\u672c\u4ec5\u9650\u4e8e\u6dd8\u5b9d\u8be6\u60c5\u9875/\u5957\u9910\u9875/\u4f18\u60e0\u5238\u9875\u9762\u4f7f\u7528");null!=prompt("\u4f18\u5316\u7248\u94fe\u63a5\uff1a",b)&&(window.location.href=b)})();
How to use
Use Demo
-- 完 --