Greasy Fork

Greasy Fork is available in English.

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

淘宝天猫内部优惠券

当前为 2018-10-05 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         淘宝天猫内部优惠券.taobao,tianmao,tmall
// @namespace    淘宝天猫内部优惠券.taobao,tianmao,tmall
// @version      2.15
// @description  淘宝天猫内部优惠券
// @author       淘宝天猫内部优惠券
// @include      http*://item.taobao.com/*
// @include      http*://detail.tmall.com/*
// @require      https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 淘宝天猫优惠券,查找优惠券!!!
    $(document).ready(function() {
      var str_host       = window.location.host;
      var str_host_name  = 'taobao';
      var str_goods_name = '';//$(document).attr('title');
      if(str_host.indexOf('taobao.com')==-1) str_host_name = 'tm';
      if(str_host_name=='taobao'){
          str_goods_name = $('.tb-main-title').text();
      }else{
          str_goods_name = $('meta[name=keywords]').attr('content');
      }
      str_goods_name=$.trim(str_goods_name);

     var btn_quan_taobao = '<a style="display: inline-block;font-size: 40px;font-weight: normal;height:40px;line-height:40px;text-align: " href="https://www.ishtq.com/?m=search&a=index&k='+ encodeURI(str_goods_name) +'" target="_blank">找优惠券</a>';
     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://www.ishtq.com/?m=search&a=index&k='+ encodeURI(str_goods_name) +'">找优惠券</a></div>';
      var faNode = document.querySelector("div#J_Title p.tb-subtitle, div.tb-detail-hd");
      if(str_host_name=='taobao'){
          $('.tb-action').append(btn_quan_taobao);
          $('.tb-action').append(btn_search_taobao);

      }else{
          $('.tb-sku').append(btn_quan_tmall);
          $('.tb-sku').append(btn_search_tmall);
      }
    });
})();