1const observer = new MutationObserver(function(mutations_list) { 2 mutations_list.forEach(function(mutation) { 3 mutation.addedNodes.forEach(function(added_node) { 4 // Attempt to get the element using document.getElementById. 5 var element = document.getElementById("onetrust-reject-all-handler"); 6 7 if (typeof(element) != 'undefined' && element != null && added_node.id === 'onetrust-consent-sdk') { 8 // Find the location button. The modal is added to the DOM after user accepted or rejected the onetrust consent. 9 const locationBtn = document.querySelector(".location-selection-btn.active"); 10 if (typeof(locationBtn) != 'undefined' && locationBtn != null) { 11 document.querySelector("#onetrust-reject-all-handler").addEventListener("click", function (event) { 12 locationBtn.focus(); 13 }); 14 document.querySelector("#onetrust-accept-btn-handler").addEventListener("click", function (event) { 15 locationBtn.focus(); 16 }); 17 } 18 observer.disconnect(); 19 } 20 21 if (added_node.id === 'sanctuaryLocationModal') { 22 // If no matches are found, null is returned. 23 const onetrustElement = document.querySelector(".onetrust-pc-dark-filter.ot-fade-in"); 24 25 // Find the location button. 26 const locationBtn = document.querySelector(".location-selection-btn.active"); 27 28 if (onetrustElement != null && window.getComputedStyle(onetrustElement).display === "none") { 29 if (locationBtn != null) { 30 locationBtn.focus(); 31 } 32 observer.disconnect(); 33 } 34 } 35 }); 36 }); 37}); 38 39observer.observe(document.querySelector("body"), { subtree: true, childList: true });
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.