1// LM-100892: Once page process mkt_tok, remove parameter from URL 2(function() { 3 var afterLoad = function (fn) { 4 if (window.attachEvent) { 5 window.attachEvent('onload', fn); 6 } else { 7 window.addEventListener('load', fn); 8 } 9 }; 10 afterLoad(function () { 11 // LM-123191: Remaining '&' from removal of 'mkt_tok=' in tracked links from emails 12 // Parse all query parameters of location.search, remove mkt_tok, then reassemble the rest 13 if (location.search && location.search.length > 1 && location.search[0] == '?') { 14 var newSearch = '', stripped = false, params = location.search.substring(1).split('&'); 15 params.forEach(function(item) { 16 if (item) { 17 if (item.indexOf('mkt_tok=') === 0) { 18 // Cache mkt_tok value into global variable, before stripping it from URL 19 window.__mktTokVal = window.__mktTokVal || item.substring(8); 20 stripped = true; 21 } 22 else { 23 // Put together the new "search" query except the leading '?' 24 newSearch += (newSearch ? '&' : '') + item; 25 } 26 } 27 }); 28 if (stripped) { 29 // If, and only if, mkt_tok= parameter was found and stripped 30 // Replace window history entry with updated search portion of original URL 31 window.history && history.replaceState('', null, location.pathname + (newSearch ? '?' + newSearch : '') + location.hash); 32 } 33 } 34 }); 35})();
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.