bs复制key

try to take over the world!

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         bs复制key
// @namespace    http://tampermonkey.net/
// @match        https://www.bundlestars.com/en/orders/*
// @description  try to take over the world!
// @grant        none
// @version      0.1
// ==/UserScript==

(function () {
  var gd_btn = $('<div><a href="javascript:;" style="color:#ffd700">一键刮KEY</a>|<a href="javascript:;" style="color:#ffd700">复制key(asf格式)</a><textarea style="top:-1px;left:-1px;width:0px;height:0px;position:absolute"></textarea></div>'),
  gd_txta = gd_btn.find('textarea');

    gd_btn.find('a').eq(0).click(function () {
        $('.key-container.hidden-sm.hidden-xs div a').click();
    });
    
    gd_btn.find('a').eq(1).click(function () {
    var keystr='!redeem ';
    $('.key-reveal-copy.ng-scope div input').each(function(i,el){
    keystr+=$(el).val()+',';});
    gd_copy(keystr.slice(-1)==','?keystr.slice(0,-1):keystr);
    
    alert(keystr + '已拷贝到剪切板!');
  });
    
  $('div.well.no-round h2').after(gd_btn);
    
    function gd_copy(gd_str) {
    gd_txta.val(gd_str).select();
    document.execCommand('copy');
  }
}) ();