// ==UserScript== // @name flickr - open an amount of next pages at once // @namespace https://greasyfork.org/en/scripts/422401-flickr-open-an-amount-of-next-pages-at-once // @version 0.6 // @description flickr - open a specific amount of next pages at once - big button to close the page with a click // @author ClaoDD // @include https://www.flickr.com/* // @grant none // @downloadURL none // ==/UserScript== var indirizzoPhotos = window.location.href; if (indirizzoPhotos.indexOf('photos') > -1 || indirizzoPhotos.indexOf('groups') > -1) { var divmio = document.createElement("div"); divmio.style.cssText = 'position:static;width:100%;height:120px;opacity:0;z-index:100;'; var button = document.createElement("button"); button.innerHTML = "open the next ... pages"; button.style.position = "relative"; button.style.left = "10%"; var buttonO = document.createElement("button"); buttonO.innerHTML = "open the next page"; buttonO.style.position = "relative"; buttonO.style.left = "50%"; buttonO.style.backgroundColor = "#ffffff"; buttonO.style.color = "#008ddf"; buttonO.style.border = "2px solid"; buttonO.style.width = "10%"; buttonO.style.height = "500px"; var buttonClose = document.createElement("button"); buttonClose.innerHTML = "Close this page"; buttonClose.style.backgroundColor = "#ffffff"; buttonClose.style.color = "#008ddf"; buttonClose.style.border = "2px solid"; buttonClose.style.width = "26%"; //change this value for the width of the "Close this page" button buttonClose.style.height = "500px"; //change this value for the height of the "Close this page" button buttonClose.style.position = "relative"; buttonClose.style.left = "51%"; var button10 = document.createElement("button"); button10.innerHTML = "10"; button10.style.position = "relative"; button10.style.left = "11%"; document.body.appendChild(divmio); document.body.insertBefore(button, divmio); document.body.insertBefore(button10, divmio); document.body.insertBefore(buttonO, divmio); document.body.insertBefore(buttonClose, divmio); buttonO.addEventListener("click", function() { var indirizzo2 = window.location.href; var indirizzoDiviso2 = indirizzo2.split('page'); var numCorrente2 = indirizzoDiviso2[indirizzoDiviso2.length -1]; var indirizzoSenzaNum2 = indirizzoDiviso2.splice(0, (indirizzoDiviso2.length -1)); window.open(indirizzoSenzaNum2 +'page'+(parseInt(numCorrente2, 10)+ 1), "_self"); }); button.addEventListener("click", function() { var indirizzo = window.location.href; var indirizzoDiviso = indirizzo.split('page'); var numCorrente = indirizzoDiviso[indirizzoDiviso.length -1]; var numNew = numCorrente; var indirizzoSenzaNum = indirizzoDiviso.splice(0, (indirizzoDiviso.length -1)); if (indirizzo.indexOf('page') > -1) { var numPages = prompt("how many pages to open?"); var numStart = 1; while (numStart <= numPages) { window.open(indirizzoSenzaNum +'page'+(parseInt(numCorrente, 10)+numStart), "_blank"); numStart = numStart + 1; } button.innerHTML = "...opened"; } }); button10.addEventListener("click", function() { var indirizzo = window.location.href; var indirizzoDiviso = indirizzo.split('page'); var numCorrente = indirizzoDiviso[indirizzoDiviso.length -1]; var numNew = numCorrente; var indirizzoSenzaNum = indirizzoDiviso.splice(0, (indirizzoDiviso.length -1)); if (indirizzo.indexOf('page') > -1) { var numPages = 10; var numStart = 1; while (numStart <= numPages) { window.open(indirizzoSenzaNum +'page'+(parseInt(numCorrente, 10)+numStart), "_blank"); numStart = numStart + 1; } button10.innerHTML = "__"; } }); buttonClose.addEventListener("click", function() { window.close(); }); }