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==
 | ||||
| // @name         Viewcomic Scraper
 | ||||
| // @namespace    danielrayjones
 | ||||
| // @version      0.0.3
 | ||||
| // @version      0.0.4
 | ||||
| // @description  Scrape comics from viewcomic.com
 | ||||
| // @author       Dan Jones
 | ||||
| // @match        http://viewcomic.com/*
 | ||||
|  | @ -32,8 +32,11 @@ | |||
|         let name = end ? end : 'comic'; | ||||
| 
 | ||||
|         let imgs = $('div.pinbin-copy img.picture').toArray(); | ||||
|         console.log(imgs); | ||||
| 
 | ||||
|         function getOne() { | ||||
|             if (!imgs.length) return; | ||||
| 
 | ||||
|             let img = imgs.shift(); | ||||
|             console.log(img.src); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue