mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Made URL change check less ressources taking
This commit is contained in:
		@@ -547,15 +547,21 @@ window.location.changed = function(e){};
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(function() //create a scope so 'location' is not global
 | 
					(function() //create a scope so 'location' is not global
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    var m_loc = window.location.href;
 | 
						/*var m_loc = window.location.href;
 | 
				
			||||||
    setInterval(function()
 | 
						
 | 
				
			||||||
 | 
						const doCheckup = function()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        if(m_loc != window.location.href)
 | 
					        if(m_loc != window.location.href)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
			m_loc = window.location.href;
 | 
								m_loc = window.location.href;
 | 
				
			||||||
			window.location.changed(window.location);
 | 
								window.location.changed(window.location);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }, 900);
 | 
					    };*/
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						window.addEventListener("popstate", 
 | 
				
			||||||
 | 
							e => window.location.changed(window.location));
 | 
				
			||||||
 | 
						
 | 
				
			||||||
})();
 | 
					})();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user