flickr - open an amount of next pages at once

flickr - open a specific amount of next pages at once - big button to close the page with a click

当前为 2021-03-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name flickr - open an amount of next pages at once
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description flickr - open a specific amount of next pages at once - big button to close the page with a click
  6. // @author ClaoDD
  7. // @include https://www.flickr.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. var indirizzo = window.location.href;
  12. var indirizzoPhotos = window.location.href;
  13. if (indirizzoPhotos.indexOf('photos') > -1 || indirizzoPhotos.indexOf('groups') > -1) {
  14.  
  15. var divmio = document.createElement("div");
  16. divmio.style.cssText = 'position:static;width:100%;height:120px;opacity:0;z-index:100;';
  17. var button = document.createElement("button");
  18. button.innerHTML = "open the next ... pages";
  19. button.style.position = "relative";
  20. button.style.left = "10%";
  21.  
  22. var buttonClose = document.createElement("button");
  23. buttonClose.innerHTML = "Close this page";
  24. buttonClose.style.backgroundColor = "#ffffff";
  25. buttonClose.style.color = "#008ddf";
  26. buttonClose.style.border = "2px solid";
  27. buttonClose.style.width = "45%"; //change this value for the width of the "Close this page" button
  28. buttonClose.style.height = "200px"; //change this value for the height of the "Close this page" button
  29. buttonClose.style.position = "relative";
  30. buttonClose.style.left = "40%";
  31.  
  32. document.body.appendChild(divmio);
  33. document.body.insertBefore(button, divmio);
  34. document.body.insertBefore(buttonClose, divmio);
  35.  
  36. button.addEventListener("click", function() {
  37.  
  38.  
  39. var indirizzoDiviso = indirizzo.split('page');
  40. var numCorrente = indirizzoDiviso[indirizzoDiviso.length -1];
  41. var numNew = numCorrente;
  42. var indirizzoSenzaNum = indirizzoDiviso.splice(0, (indirizzoDiviso.length -1));
  43.  
  44.  
  45.  
  46.  
  47. var numPages = prompt("how many pages to open?");
  48. var numStart = 1;
  49. while (numStart <= numPages) {
  50. window.open(indirizzoSenzaNum +'page'+(parseInt(numCorrente, 10)+numStart), "_blank");
  51. numStart = numStart + 1;
  52. }
  53. button.innerHTML = "...opened";
  54. });
  55.  
  56.  
  57. buttonClose.addEventListener("click", function() {
  58. window.close();
  59. });
  60.  
  61. }