1/** 2 * Dismiss handler for the Android app download banner. 3 * Loaded with `defer` (non render-blocking). The banner is dismissed both when 4 * the user closes it (Ã) and when they tap INSTALEAZÄ. Dismissing removes the 5 * `show-app-banner` class (hides via CSS) and persists the choice in a cookie so 6 * the pre-paint <head> script won't re-show it: 7 * - Ã (close) â 7 days 8 * - INSTALEAZÄ â 30 days (they engaged, so back off longer) 9 */ 10(function () { 11 var banner = document.querySelector('[data-app-banner]'); 12 if (!banner) return; 13 14 function dismiss(days) { 15 document.documentElement.classList.remove('show-app-banner'); 16 17 var expires = new Date(); 18 expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000); 19 document.cookie = 20 'appBannerClosed=1; expires=' + 21 expires.toUTCString() + 22 '; path=/; SameSite=Lax'; 23 } 24 25 var closeBtn = banner.querySelector('[data-app-banner-close]'); 26 if (closeBtn) { 27 closeBtn.addEventListener('click', function () { 28 dismiss(7); 29 }); 30 } 31 32 // Two install buttons exist (Android/iOS), only one is visible per platform. 33 var installBtns = banner.querySelectorAll('[data-app-banner-install]'); 34 for (var i = 0; i < installBtns.length; i++) { 35 installBtns[i].addEventListener('click', function () { 36 dismiss(30); 37 }); 38 } 39})();
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.