1function getParameterByName(name, url) { 2 if (!url) { 3 url = window.location.href; 4 } 5 name = name.replace(/[\[\]]/g, "\\$&"); 6 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 7 results = regex.exec(url); 8 if (!results) return null; 9 if (!results[2]) return ''; 10 return decodeURIComponent(results[2].replace(/\+/g, " ")); 11} 12 13function setCookie(name, value, options) { 14 options = options || {}; 15 var expires = ''; 16 if (options.lifetime && options.lifetime !== -1) { 17 var date = new Date(); 18 date.setTime(date.getTime() + (options.lifetime * 24 * 60 * 60 * 1000)); 19 expires = '; expires=' + date.toGMTString(); 20 } 21 22 document.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + expires + '; path=' + (options.path || '/'); 23} 24 25document.addEventListener('DOMContentLoaded', function () { 26 var mpId = getParameterByName("mpid"); 27 if (mpId) { 28 setCookie("mpId", mpId, { samesite: 'lax', path: '/', lifetime: 7 }); 29 } 30});
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.