您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
淘宝&天猫评价页面添加一键好评按钮
当前为
// ==UserScript== // @name 淘宝&天猫一键好评 // @description 淘宝&天猫评价页面添加一键好评按钮 // @version 1.4 // @author JoJunIori // @namespace [email protected] // @grant unsafeWindow // @include http://rate.taobao.com/* // @include https://rate.taobao.com/* // @include http://ratewrite.tmall.com/* // @include https://ratewrite.tmall.com/* // ==/UserScript== var host = window.location.host; var isTB = host === 'rate.taobao.com'; var isTM = host === 'ratewrite.tmall.com'; // 淘宝一键好评 function taobaoFun() { var tbParentElem = document.querySelector('.submitbox'); var tbGoodRate = document.querySelectorAll('.good-rate'); var tbStar = document.querySelectorAll('.ks-simplestar img'); var tbSubmitBtn = document.querySelector('.J_submit_rate'); var tbNewDir = document.createElement('button'); tbNewDir.innerHTML = '一键好评'; tbNewDir.className = 'tb-rate-btn type-primary tb-rate-btn haoping'; tbNewDir.style.marginLeft = '50px'; tbNewDir.onclick = function() { for (var i = 0, a; a = tbGoodRate[i++];) { a.click(); } tbStar[4].click(); tbStar[9].click(); tbStar[14].click(); tbSubmitBtn.click(); }; tbParentElem.appendChild(tbNewDir); } // 天猫一键好评 function tmallFun() { var tmParentElem = document.querySelector('.compose-btn'); var tmStar = document.querySelectorAll('[data-star-value="5"]'); var tmSubmitBtn = document.querySelector('.compose-btn [type="submit"]'); var tmNewDir = document.createElement('button'); tmNewDir.innerHTML = '一键好评'; tmNewDir.className = 'tb-rate-btn type-primary tb-rate-btn haoping'; tmNewDir.style.background = 'white'; tmNewDir.style.color = '#c40000'; tmNewDir.style.border = 'inset 1px #c40000'; tmNewDir.onclick = function() { for (var i = 0, a; a = tmStar[i++];) { a.click(); } tmSubmitBtn.click(); }; console.log(tmParentElem); console.log(tmNewDir); tmParentElem.appendChild(tmNewDir); } if (isTB) { taobaoFun(); } else if (isTM) { var timer = setInterval(detection, 1000); function detection() { var haoping = document.querySelector('.haoping'); if (!haoping) { tmallFun(); } else { clearInterval(timer); } } }