idHelper

try to take over the world!

当前为 2019-09-13 提交的版本,查看 最新版本

// ==UserScript==
// @resource icon1 http://tampermonkey.net/favicon.ico
// @name         idHelper
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       yao
// @match

// @include https://www.buyoyo.com/*
// @grant        none
//@require  http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    var button = $("<input type='button' value='id' />");
    button.css({
        width:40
    });
    var pa = /\d+/;
    button.click(function(){
        var url = $(this).prev().attr('href');
        var id = pa.exec(url)[0];
        // 创建'虚拟'DOM
        const input = document.createElement('input')
        document.body.appendChild(input)
        input.setAttribute('value', id)
        input.select()
        if (document.execCommand('copy')) {
            document.execCommand('copy')
        }
        // 删除'虚拟'DOM
        document.body.removeChild(input)
        console.log(id);
    });
    $("img[src='/biz/resources/common/icon/heart.gif']").parent().parent().append(button);

})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址