1(function (Drupal, once) { 2 Drupal.behaviors.somethingWrongLink = { 3 attach: function (context) { 4 once('somethingWrongLink', '.something_wrong', context).forEach(function (link) { 5 6 link.addEventListener('click', function () { 7 // Get current relative URL (e.g. /plan-your-trip?x=y) 8 const currentPath = window.location.pathname + window.location.search + window.location.hash; 9 10 // Parse existing link href (can be dynamic) 11 const targetUrl = new URL(link.href, window.location.origin); 12 13 // Add current path as query parameter 14 targetUrl.searchParams.set('page_url', currentPath); 15 16 // Update link's href before navigation happens 17 link.href = targetUrl.pathname + targetUrl.search; 18 // No preventDefault() â let normal navigation happen 19 }, { once: true }); // only modify once per page load 20 }); 21 } 22 }; 23 })(Drupal, once); 24
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.