| 
				
			 | 
			
			
				@@ -1,3 +1,11 @@ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				1
			 | 
			
			
				+sites_url = "sites.json" 
			 | 
		
	
		
			
			| 
				
			 | 
			
				2
			 | 
			
			
				+sites = {} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				3
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				
			 | 
			
				4
			 | 
			
			
				+function getSitesAndMirrors() { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				5
			 | 
			
			
				+    $.getJSON("http://host.brendanabolivier.com/files/56bf24564ab24.json") 
			 | 
		
	
		
			
			| 
				
			 | 
			
				6
			 | 
			
			
				+                                    .done(function(data) { sites = data }) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				7
			 | 
			
			
				+} 
			 | 
		
	
		
			
			| 
				
			 | 
			
				8
			 | 
			
			
				+ 
			 | 
		
	
		
			
			| 
				1
			 | 
			
				9
			 | 
			
			
				 function getCurrentTabUrl(callback) { 
			 | 
		
	
		
			
			| 
				2
			 | 
			
				10
			 | 
			
			
				   // Query filter to be passed to chrome.tabs.query - see 
			 | 
		
	
		
			
			| 
				3
			 | 
			
				11
			 | 
			
			
				   // https://developer.chrome.com/extensions/tabs#method-query 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -39,7 +47,7 @@ function getCurrentTabUrl(callback) { 
			 | 
		
	
		
			
			| 
				39
			 | 
			
				47
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				40
			 | 
			
				48
			 | 
			
			
				 function updateTab() { 
			 | 
		
	
		
			
			| 
				41
			 | 
			
				49
			 | 
			
			
				     getCurrentTabUrl(function(url) { 
			 | 
		
	
		
			
			| 
				42
			 | 
			
				
			 | 
			
			
				-        if(url.match(/:\/\/(.+)\//)[1] == "www.ijavn.org") { 
			 | 
		
	
		
			
			| 
				
			 | 
			
				50
			 | 
			
			
				+        if(url.match(/:\/\/(.+)\//)[1] in sites) { 
			 | 
		
	
		
			
			| 
				43
			 | 
			
				51
			 | 
			
			
				             chrome.browserAction.setIcon({path: 'icon-red.png'}) 
			 | 
		
	
		
			
			| 
				44
			 | 
			
				52
			 | 
			
			
				         } 
			 | 
		
	
		
			
			| 
				45
			 | 
			
				53
			 | 
			
			
				         else { 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -48,5 +56,6 @@ function updateTab() { 
			 | 
		
	
		
			
			| 
				48
			 | 
			
				56
			 | 
			
			
				     }) 
			 | 
		
	
		
			
			| 
				49
			 | 
			
				57
			 | 
			
			
				 } 
			 | 
		
	
		
			
			| 
				50
			 | 
			
				58
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				59
			 | 
			
			
				+chrome.runtime.onStartup.addListener(getSitesAndMirrors) 
			 | 
		
	
		
			
			| 
				51
			 | 
			
				60
			 | 
			
			
				 chrome.tabs.onActivated.addListener(updateTab) 
			 | 
		
	
		
			
			| 
				52
			 | 
			
				61
			 | 
			
			
				 chrome.tabs.onUpdated.addListener(updateTab) 
			 |