New Userscript

try to take over the world!

目前為 2021-03-02 提交的版本,檢視 最新版本

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://play.google.com/store/apps/details?id=*
// @grant        none
// @license      MIT License
// @run-at       document-end
// @connect      *://*.sinaimg.cn
// ==/UserScript==

(function() {
    // Your code here...
     var a = document.createElement('a');
    a.innerHTML = 'download';
    a.download = document.getElementsByClassName("AHFaub")[0].innerText;
    a.click();
     var doDownload = function(blob, filename) {
       var a = document.createElement('a');
       a.download = filename;
       a.href = blob;
       a.click();
  }
    var container = document.getElementsByClassName("hfWwZc")[0];
    container.insertBefore(a,container.childNodes[0]);

    a.addEventListener('click', function (ev) {
    var blob = document.getElementsByClassName("xSyT2c")[0].childNodes[0].getAttribute('src').split("=s")[0]+"=s512-rw";
    var filename = document.getElementsByClassName("AHFaub")[0].innerText;
    download(blob,filename);
  });

     var download = function (url, filename) {
     if (!filename) filename = url.split('\\').pop().split('/').pop();
     fetch(url, {
        headers: new Headers({
          'Origin': location.origin
      }),
       mode: 'cors'
     })
    .then(response => response.blob())
    .then(blob => {
      let blobUrl = window.URL.createObjectURL(blob);
      doDownload(blobUrl, filename);
    })
    .catch(e => {console.error(e); return false;});

    return true;
  }

})();

QingJ © 2025

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