PageSourceSearch

https://www.hcpdconference.com/wp-content/plugins/ai-osano-integra…/assets/js/ai-osano-reprompt.js?ver=1.0.8

js hcpdconference.com collected 2026-10-05 10:49:31 UTC 3,020 bytes, 77 lines download raw bytes

1(function () {
2   // Get VERSION from WordPress localized script data (ai_osano_reprompt object already exists)
3   var VERSION = ai_osano_reprompt.timestamp || "";
4   var KEY = "osano_consent_reset_version";
5
6   // Exit early if no timestamp is configured
7   if (!VERSION) {
8      ai_osano_reprompt.log("No reprompt timestamp configured, skipping");
9      return;
10   }
11
12   // Quiet cookie clear: only delete on domains we can actually set
13   function clearOsanoCookiesQuiet() {
14      try {
15         var host = location.hostname;
16         var parts = host.split(".");
17         var candidates = ["", "." + host];                 // host-only, explicit host
18         if (parts.length > 2) candidates.push("." + parts.slice(-2).join(".")); // naive parent (.example.com)
19
20         // keep only usable domains (probe)
21         var usable = [];
22         candidates.forEach(function (dom) {
23            var probe = "__os_probe=" + Date.now();
24            document.cookie = probe + "; Path=/" + (dom ? "; Domain=" + dom : "");
25            if (document.cookie.indexOf("__os_probe=") !== -1) {
26               usable.push(dom);
27               document.cookie = "__os_probe=; Max-Age=0; Path=/" + (dom ? "; Domain=" + dom : "");
28            }
29         });
30
31         // delete Osano cookies on usable domains
32         document.cookie.split(";").forEach(function (raw) {
33            var name = raw.split("=")[0].trim();
34            if (name.toLowerCase().indexOf("osano") === 0) {
35               usable.forEach(function (dom) {
36                  document.cookie = name + "=; Max-Age=0; Path=/" + (dom ? "; Domain=" + dom : "");
37                  ai_osano_reprompt.log("Cleared cookie:", name, dom || "(host)");
38               });
39            }
40         });
41      } catch (e) {
42         ai_osano_reprompt.log("cookie clear failed:", e);
43      }
44   }
45
46   function clearOsanoLocalStorage() {
47      try {
48         Object.keys(localStorage).forEach(function (k) {
49            if (k.indexOf("osano_") === 0) {
50               localStorage.removeItem(k);
51               ai_osano_reprompt.log("Cleared LS key:", k);
52            }
53         });
54      } catch (e) {
55         ai_osano_reprompt.log("LS clear failed:", e);
56      }
57   }
58
59   try {
60      // Check if we need to reprompt - only if VERSION is greater than stored version
61      var storedVersion = localStorage.getItem(KEY);
62      var currentVersion = parseInt(VERSION, 10);
63      var previousVersion = storedVersion ? parseInt(storedVersion, 10) : 0;
64
65      if (currentVersion > previousVersion) {
66         clearOsanoLocalStorage();
67         clearOsanoCookiesQuiet();
68         localStorage.setItem(KEY, VERSION); // mark done so it runs only once per VERSION
69         ai_osano_reprompt.log("Completed reprompt for timestamp", VERSION, "(" + new Date(currentVersion * 1000).toISOString() + ")");
70      } else {
71         ai_osano_reprompt.log("Consent reset already done for timestamp", VERSION, "or newer");
72      }
73   } catch (e) {
74      ai_osano_reprompt.log("Error:", e);
75   }
76})();
77

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.