flickr - open an amount of next pages at once

flickr - open a specific amount of next pages at once

当前为 2021-02-28 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name flickr - open an amount of next pages at once
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description flickr - open a specific amount of next pages at once
  6. // @author ClaoDD
  7. // @include https://www.flickr.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var indirizzoPhotos = window.location.href;
  12. if (indirizzoPhotos.indexOf('photos') > -1) {
  13.  
  14. var divmio = document.createElement("div");
  15. divmio.style.cssText = 'position:static;width:100%;height:120px;opacity:0;z-index:100;';
  16. var button = document.createElement("button");
  17. button.innerHTML = "open the next ... pages";
  18. document.body.appendChild(divmio);
  19. document.body.insertBefore(button, divmio);
  20.  
  21. button.addEventListener("click", function() {
  22.  
  23. var indirizzo = window.location.href;
  24. var indirizzoDiviso = indirizzo.split('page');
  25. var numCorrente = indirizzoDiviso[indirizzoDiviso.length -1];
  26. var numNew = numCorrente;
  27. var indirizzoSenzaNum = indirizzoDiviso.splice(0, (indirizzoDiviso.length -1));
  28.  
  29. if (indirizzo.indexOf('page') > -1) {
  30. var numPages = prompt("how many pages to open?");
  31. var numStart = 1;
  32. while (numStart <= numPages) {
  33. window.open(indirizzoSenzaNum +'page'+(parseInt(numCorrente, 10)+numStart), "_blank");
  34. numStart = numStart + 1;
  35. }
  36. button.innerHTML = "...opened";
  37. }
  38. });
  39. }