javlib信息复制

复制javlib页面的影片信息

// ==UserScript==
// @name         javlib信息复制
// @description  复制javlib页面的影片信息
// @match        *://www.e59f.com/*
// @grant        GM_setClipboard
// @version 0.0.1.30220215161130
// @namespace https://greasyfork.org/users/857018
// ==/UserScript==


(function() {
    'use strict';
    document.querySelectorAll('h3.post-title.text').forEach(element => {

        let btn = document.createElement('button')
        btn.innerText = '复制'
        element.before(btn)
        var tr = document.createElement("tr");
        var td = document.createElement("td");
        tr.appendChild(btn);
        tr.appendChild(td);
        td.innerText = element.innerText


        element.before(tr)
        element.remove()
        btn.addEventListener('click',(e)=>{
        e.preventDefault()
        GM_setClipboard(element.innerText)
        })

      });
})();

(function() {
    'use strict';
    document.querySelectorAll('div.id').forEach(element => {

        let btn = document.createElement('button')
        btn.innerText = '复制'
        element.before(btn)
          var tr = document.createElement("tr");
          var td = document.createElement("td");
          tr.appendChild(td);
          td.innerText = element.innerText
          tr.appendChild(btn);

        element.before(tr)
        element.remove()
        btn.addEventListener('click',(e)=>{
          e.preventDefault()
          GM_setClipboard(element.innerText)
        })

      });
})();


(function() {
    'use strict';
    let element = document.querySelectorAll('.item .text')

        let btn = document.createElement('button')
        btn.innerText = '复制'
        element[0].before(btn)

      btn.addEventListener('click',(e)=>{
        e.preventDefault()
        GM_setClipboard(element[0].innerText)

    });

})();

(function() {
    'use strict';
    let element = document.querySelectorAll('.item .text')

        let btn = document.createElement('button')
        btn.innerText = '复制'
        let x = element.length
        element[x-1].before(btn)

      btn.addEventListener('click',(e)=>{
        e.preventDefault()
        GM_setClipboard(element[x-1].innerText)

    });

})();



(function() {
    'use strict';
    let element = document.querySelectorAll('.item .text')

      let btn = document.createElement('button')
      btn.innerText = '搜索'
      element[0].after(btn)

      btn.addEventListener('click',(e)=>{
        e.preventDefault()
//        GM_setClipboard(element.innerText)
        let movieid = element[0].innerText;
          var website = "https://btsow.rest/search/"
        let fulllink = website+movieid
        window.open(fulllink)

    });


})();