Use remove, rather than removeChild, when removing the temporary Text nodes used in FirefoxCom
				
					
				
			This is the "modern" way of removing a node from the DOM, which has the benefit of being a lot shorter and more concise. Also, this patch removes the `return` statement from the "pdf.js.response" event listener, since it's always `undefined`, given that none of the `callback`-functions used here ever return anything (and don't need to either). Generally speaking, returning a value from an event listener isn't normally necessary either.
This commit is contained in:
		
							parent
							
								
									cc49b65a11
								
							
						
					
					
						commit
						99b1a62c97
					
				| @ -48,7 +48,8 @@ const FirefoxCom = (function FirefoxComClosure() { | |||||||
|       }); |       }); | ||||||
|       request.dispatchEvent(sender); |       request.dispatchEvent(sender); | ||||||
|       const response = sender.detail.response; |       const response = sender.detail.response; | ||||||
|       document.documentElement.removeChild(request); |       request.remove(); | ||||||
|  | 
 | ||||||
|       return response; |       return response; | ||||||
|     }, |     }, | ||||||
| 
 | 
 | ||||||
| @ -68,10 +69,9 @@ const FirefoxCom = (function FirefoxComClosure() { | |||||||
|           event => { |           event => { | ||||||
|             const node = event.target; |             const node = event.target; | ||||||
|             const response = event.detail.response; |             const response = event.detail.response; | ||||||
|  |             node.remove(); | ||||||
| 
 | 
 | ||||||
|             document.documentElement.removeChild(node); |             callback(response); | ||||||
| 
 |  | ||||||
|             return callback(response); |  | ||||||
|           }, |           }, | ||||||
|           { once: true } |           { once: true } | ||||||
|         ); |         ); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user