mirror of
				https://github.com/SoPat712/videospeed.git
				synced 2025-10-30 18:34:02 -04:00 
			
		
		
		
	don't reinitialize active controllers
This commit is contained in:
		
							
								
								
									
										10
									
								
								inject.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								inject.js
									
									
									
									
									
								
							| @@ -218,15 +218,7 @@ chrome.extension.sendMessage({}, function(response) { | |||||||
|       function checkForVideo(node, parent, added) { |       function checkForVideo(node, parent, added) { | ||||||
|         if (node.nodeName === 'VIDEO') { |         if (node.nodeName === 'VIDEO') { | ||||||
|           if (added) { |           if (added) { | ||||||
|             if (!node.classList.contains('vsc-initialized') && !node.dataset['vscid']) { |             if (!node.dataset['vscid']) { | ||||||
|               new tc.videoController(node, parent); |  | ||||||
|             } |  | ||||||
|             // if the video has already been initialized, then it has been mutated |  | ||||||
|             // we may need to update the controller location to reflect this |  | ||||||
|             else { |  | ||||||
|               let id = node.dataset['vscid']; |  | ||||||
|               let ctrl = document.querySelector(`div[data-vscid="${id}"]`); |  | ||||||
|               if (ctrl) ctrl.remove(); |  | ||||||
|               new tc.videoController(node, parent); |               new tc.videoController(node, parent); | ||||||
|             } |             } | ||||||
|           } else { |           } else { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ilya Grigorik
					Ilya Grigorik