1/* 2 * To change this license header, choose License Headers in Project Properties. 3 * To change this template file, choose Tools | Templates 4 * and open the template in the editor. 5 */ 6 7function getQueryParams(qs) { 8 qs = qs.split('+').join(' '); 9 10 let params = {}, 11 tokens, 12 re = /[?&]?([^=]+)=([^&]*)/g; 13 14 while (tokens = re.exec(qs)) { 15 params[decodeURIComponent(tokens[1])] = decodeURIComponent(tokens[2]); 16 } 17 18 return params; 19} 20 21 22(function($){ 23 const DOUBLE_OPEN_GET_PARAM = 'afbclid'; 24 25 $(document).on('click', 'a', function () { 26 const paramsString = this.href ? this.href.split('?')[1] : null; 27 28 if (!paramsString) return; 29 30 const params = getQueryParams(paramsString); 31 32 if (!params[DOUBLE_OPEN_GET_PARAM]) return; 33 34 const urlWithoutGetParams = this.href.split('?')[0]; 35 36 window.open(urlWithoutGetParams); 37 }) 38})(jQuery)
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.