diff options
| author | Gokulakrishna <gokulakrishnaks@gmail.com> | 2018-05-18 23:23:41 +0530 | 
|---|---|---|
| committer | Gokulakrishna <gokulakrishnaks@gmail.com> | 2018-05-18 23:23:41 +0530 | 
| commit | d44b612964ef4890bbb766816d484c45cc2d71a8 (patch) | |
| tree | c6e03b781a30bf6aea27e491dfad685a5558965c | |
| parent | 7490d7adee1d7f938ee92f743c8d17f87e554848 (diff) | |
Check condition for supported sourcesystems before adding to Types in createfilter - closes #115
| -rw-r--r-- | js/background.js | 5 | 
1 files changed, 5 insertions, 0 deletions
diff --git a/js/background.js b/js/background.js index 4d6ac71..2f99793 100644 --- a/js/background.js +++ b/js/background.js @@ -136,9 +136,14 @@ function createFilter(redirects) {  	var types = [];  	for (var i = 0; i < redirects.length; i++) {  		redirects[i].appliesTo.forEach(function(type) {  +			// Added this condition below as part of fix for issue 115 https://github.com/einaregilsson/Redirector/issues/115 +			// Firefox considers responsive web images request as imageset. Chrome doesn't. +			// Chrome throws an error for imageset type, so let's add to 'types' only for the values that chrome or firefox supports +			if(chrome.webRequest.ResourceType[type.toUpperCase()]!== undefined){  			if (types.indexOf(type) == -1) {  				types.push(type);  			} +		}  		});  	}  	types.sort();  | 
