1(function() { 2 function gaaVidere() { 3 // nettleser er godkjent, så vi kan tillate oss litt mer 4 var url = window.location.href; 5 var queryParamStart = url.indexOf('?'); 6 var queryparams = url.substring(queryParamStart) 7 .replace('?', '') 8 .split('&') 9 .reduce(function(obj, paramSet) { 10 var split = paramSet.split('='); 11 obj[split[0]] = split[1]; 12 return obj; 13 }, {}); 14 15 if (!queryparams.redirectUrl) { 16 console.log('Sjekk ok, mangler redirectUrl'); 17 } 18 19 var decodedUri = decodeURIComponent(queryparams.redirectUrl); 20 var url = new URL(decodedUri); 21 var hostname = url.hostname; 22 23 const domains = ["skatteetaten.no", "sits.no", "skead.no"]; 24 25 const domainsRegex = ("(" + domains.join(")|(") + ")").replaceAll(".", "\\."); 26 27 const checkDomainRegex = new RegExp("^(" + domainsRegex + ")$"); 28 const checkSubDomainRegex = new RegExp("^.*\\.(" + domainsRegex + ")$"); 29 30 if((checkDomainRegex.test(hostname) || checkSubDomainRegex.test(hostname)) 31 && (url.protocol === 'http:' || url.protocol === 'https:')) 32 { 33 var uri, hash; 34 if (decodedUri.indexOf('#/') !== -1) { 35 uri = decodedUri.substr(0, decodedUri.indexOf('#/')); 36 hash = decodedUri.substr(decodedUri.indexOf('#/')); 37 } else { 38 uri = decodedUri; 39 } 40 41 var harQueryParams = uri.includes('?'); 42 43 const redirectTil = uri + 44 (harQueryParams ? '&' : '?') + 45 'nettlesersjekkok=true' + 46 (hash ? hash : ''); 47 48 window.location.href = redirectTil; 49 } 50 else 51 { 52 console.log("Ugyldig redirectUrl eller protokoll"); 53 window.location.href = 'https://www.skatteetaten.no/'; 54 return; 55 } 56 } 57 58 function gaaTilFeilside(feature) { 59 console.log('Mangler støtte for ' + feature + ', går til feilside'); 60 61 window.location.href = 'https://www.skatteetaten.no/system/nettlesersjekk?rules=' + feature; 62 } 63 64 if (typeof Object === 'undefined' || !Object.entries) { 65 gaaTilFeilside('Object.entries'); 66 return; 67 } 68 69 var modernizr = window.Modernizr; 70 var rules = Object.entries(modernizr) 71 for (var i = 0; i < rules.length; i++) { 72 var key = rules[i][0]; 73 var value = rules[i][1]; 74 75 if (!value) { 76 gaaTilFeilside(key); 77 return; 78 } 79 } 80 81 gaaVidere(); 82})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.