Greasy Fork is available in English.

淘宝天猫内部优惠券.taobao,tianmao,tmall

淘宝天猫内部优惠券

Stan na 21-07-2018. Zobacz najnowsza wersja.

  1. // ==UserScript==
  2. // @name 淘宝天猫内部优惠券.taobao,tianmao,tmall
  3. // @namespace 淘宝天猫内部优惠券.taobao,tianmao,tmall
  4. // @version 1.56
  5. // @description 淘宝天猫内部优惠券
  6. // @author 淘宝天猫内部优惠券
  7. // @include http*://item.taobao.com/*
  8. // @include http*://detail.tmall.com/*
  9. // @require https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. // 淘宝天猫优惠券,查找优惠券!!!
  16. $(document).ready(function() {
  17. var str_host = window.location.host;
  18. var str_host_name = 'taobao';
  19. var str_goods_name = '';//$(document).attr('title');
  20. if(str_host.indexOf('taobao.com')==-1) str_host_name = 'tm';
  21. if(str_host_name=='taobao'){
  22. str_goods_name = $('.tb-main-title').text();
  23. }else{
  24. str_goods_name = $('meta[name=keywords]').attr('content');
  25. }
  26. str_goods_name=$.trim(str_goods_name);
  27.  
  28. var btn_quan_taobao = '<a style="display: inline-block;font-size: 40px;font-weight: normal;height:40px;line-height:40px;text-align: " href="https://quan.ishfx.cn/index.php?r=searchlist&kwd='+ encodeURI(str_goods_name) +'" target="_blank">找优惠券</a>';
  29. var btn_quan_tmall = '<div class="tb-action" style="margin-top:0"><a style="display: inline-block;padding:;font-size: 40px;font-weight: normal;height:40px;line-height:40px;width:200px;text-align: " href="https://quan.ishfx.cn/index.php?r=searchlist&kwd='+ encodeURI(str_goods_name) +'">找优惠券</a></div>';
  30. var faNode = document.querySelector("div#J_Title p.tb-subtitle, div.tb-detail-hd");
  31. if(str_host_name=='taobao'){
  32. $('.tb-action').append(btn_quan_taobao);
  33. $('.tb-action').append(btn_search_taobao);
  34.  
  35. }else{
  36. $('.tb-sku').append(btn_quan_tmall);
  37. $('.tb-sku').append(btn_search_tmall);
  38. }
  39. });
  40. })();