Virtualmanager.com - Open all on free transfer to training page

Open all on free transfer to training page

目前为 2023-09-21 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Virtualmanager.com - Open all on free transfer to training page
  3. // @namespace https://greasyfork.org/en/users/884999-l%C3%A6ge-manden
  4. // @version 0.1
  5. // @description Open all on free transfer to training page
  6. // @author VeryDoc
  7. // @match https://www.virtualmanager.com/free_transfer_listings?*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=virtualmanager.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. let OpenAllButton = document.createElement('button');
  17. OpenAllButton.className = 'btn';
  18. OpenAllButton.innerText = 'Open all';
  19. OpenAllButton.onclick = function () { OpenAll(); };
  20.  
  21. var attachbox = document.getElementsByClassName('search')[0];
  22.  
  23. attachbox.appendChild(OpenAllButton);
  24.  
  25. function OpenAll() {
  26. var photos = document.getElementsByClassName('photo');
  27. var x = 100;
  28. for (let photo of photos) {
  29. setTimeout(openWindow, x, photo.href + "/training");
  30. x += 100;
  31. }
  32. }
  33.  
  34. function openWindow(s){
  35. // console.log(s);
  36. window.open(s, "_blank");
  37. }
  38. })();