WorldCosplay Download

Download the linked image on WorldCosplay photo pages

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        WorldCosplay Download
// @author      Arnold François Lecherche
// @namespace   https://greasyfork.org
// @icon        http://worldcosplay.net/favicon.ico
// @version     0.1
// @description Download the linked image on WorldCosplay photo pages
// @include     http://worldcosplay.net/photo/*
// @include     http://*.worldcosplay.net/photo/*
// @include     https://worldcosplay.net/photo/*
// @include     https://*.worldcosplay.net/photo/*
// @grant       none
// @run-at      document-end
// ==/UserScript==

setTimeout(function imgdl() {
  'use strict';
  var clks = document.getElementsByClassName('clickable'), sgn = document.getElementById('headerShader'), imgs = [], i, clk, isrc;
  for (i = clks.length; i--;) {
    clk = clks[i];
    if (clk.nodeName.toLowerCase() === 'img') {
      isrc = clk.src;
      if (/\.(?:jpe?g|png|gif)$/.test(isrc)) imgs.push(isrc);
    }
  }
  if (imgs.length) sgn.innerHTML += '<ul><li><a href="' + imgs.join('">Download</a></li><li><a href="') + '">Download</a></li></ul>';
  else setTimeout(imgdl, 16);
}, 16);