// ==UserScript== // @name 记得领券!京东PLUS会员 // @namespace jd.com // @version 20180629.1 // @description 在购物车结算页面添加一个按钮,提醒领取PLUS会员优惠券 // @author dbw9580 // @match https://cart.jd.com/cart.action* // @grant GM_addStyle // @downloadURL none // ==/UserScript== (function() { 'use strict'; const button_fix_css = ` .toolbar-wrap .btn-area .submit-btn { display: inline-block !important; } `; const button_inline_style = ` display: inline-block; position: relative; width: 96px; height: 52px; line-height: 52px; color: #fff; text-align: center; font-size: 18px; font-family: 'Microsoft YaHei'; background: #e54346; overflow: hidden; `; if (document.getElementsByClassName("submit-btn").length != 0) { GM_addStyle(button_fix_css); let father_of_submit_btn = document.getElementsByClassName("submit-btn")[0].parentElement; let template = document.createElement("template"); template.innerHTML = `去领券`; let go_get_coupon = template.content.firstChild; father_of_submit_btn.appendChild(go_get_coupon); } })();