From d44b612964ef4890bbb766816d484c45cc2d71a8 Mon Sep 17 00:00:00 2001 From: Gokulakrishna Date: Fri, 18 May 2018 23:23:41 +0530 Subject: Check condition for supported sourcesystems before adding to Types in createfilter - closes #115 --- js/background.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js') 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(); -- cgit v1.2.3