dlsite下载按钮

在dlsite的下载页面添加一个批量下载的按钮

  1. // ==UserScript==
  2. // @name dlsite下载按钮
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description 在dlsite的下载页面添加一个批量下载的按钮
  6. // @author banzhe
  7. // @match https://www.dlsite.com/*/download/split/*
  8. // @icon https://www.dlsite.com/favicon.ico
  9. // @grant unsafeWindow
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. createButton();
  16. function createButton(){
  17. let node = document.getElementsByClassName("work_dl")[0];
  18. node.innerHTML = "<input type='button' value='download' onclick='window.downloadAll()'>"
  19. }
  20. unsafeWindow.downloadAll = function(){
  21. let url_list = document.getElementsByClassName("btn_dl");
  22. for(let i=0; i<url_list.length; i++){
  23. window.open(url_list[i].href);
  24. }
  25. };
  26. })();