Don't process empty arrays
This commit is contained in:
parent
7e5653e06c
commit
47e0ba2c93
1 changed files with 4 additions and 1 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Viewcomic Scraper
|
// @name Viewcomic Scraper
|
||||||
// @namespace danielrayjones
|
// @namespace danielrayjones
|
||||||
// @version 0.0.3
|
// @version 0.0.4
|
||||||
// @description Scrape comics from viewcomic.com
|
// @description Scrape comics from viewcomic.com
|
||||||
// @author Dan Jones
|
// @author Dan Jones
|
||||||
// @match http://viewcomic.com/*
|
// @match http://viewcomic.com/*
|
||||||
|
|
@ -32,8 +32,11 @@
|
||||||
let name = end ? end : 'comic';
|
let name = end ? end : 'comic';
|
||||||
|
|
||||||
let imgs = $('div.pinbin-copy img.picture').toArray();
|
let imgs = $('div.pinbin-copy img.picture').toArray();
|
||||||
|
console.log(imgs);
|
||||||
|
|
||||||
function getOne() {
|
function getOne() {
|
||||||
|
if (!imgs.length) return;
|
||||||
|
|
||||||
let img = imgs.shift();
|
let img = imgs.shift();
|
||||||
console.log(img.src);
|
console.log(img.src);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue