PageSourceSearch

https://www.nike.com/static/experience/experimentation-eng/gridiron/no-consent-fallback.js

js nike.com collected 2026-10-01 09:11:41 UTC 3,155 bytes, 89 lines download raw bytes

1(function () {
2  var STORAGE_KEY = 'optimization-debug';
3  var EXPERIMENTATION_SCRIPTS = [
4    'https://www.nike.com/static/experience/experimentation-eng/gridiron/gridiron.js',
5    'https://www.nike.com/static/experience/experimentation-eng/optimization-client/optimization-client.js',
6    'https://www.nike.com/static/experience/experimentation-eng/bellotti/playmaker/playmaker.js'
7  ];
8
9  /**
10   * Returns true if the bypassPrivacy debug flag is active.
11   *
12   * Checks the URL param first (?bypassPrivacy=true, case-insensitive key).
13   * When the URL param is present it is persisted to sessionStorage so that
14   * subsequent navigations — where the param is no longer in the URL — also
15   * bypass the consent gate without requiring the optimization client to be
16   * loaded first.
17   *
18   * Falls back to reading sessionStorage directly, which is how the bypass
19   * remains active across page navigations once set via the E13N Debugger
20   * (window.webShellClient.optimization.__debug.setBypassPrivacy(true)).
21   */
22  function checkBypassPrivacy() {
23    try {
24      var params = new URLSearchParams(window.location.search);
25      var keys = Array.from(params.keys());
26      for (var i = 0; i < keys.length; i++) {
27        if (keys[i].toLowerCase() === 'bypassprivacy' && params.get(keys[i]) === 'true') {
28          try {
29            var existing = JSON.parse(sessionStorage.getItem(STORAGE_KEY) || '{}');
30            existing.bypassPrivacy = true;
31            sessionStorage.setItem(STORAGE_KEY, JSON.stringify(existing));
32          } catch (e) { /* no-op */ }
33          return true;
34        }
35      }
36    } catch (e) { /* no-op */ }
37
38    try {
39      var stored = JSON.parse(sessionStorage.getItem(STORAGE_KEY) || '{}');
40      return stored.bypassPrivacy === true;
41    } catch (e) { /* no-op */ }
42
43    return false;
44  }
45
46  function loadExperimentationScripts() {
47    for (var i = 0; i < EXPERIMENTATION_SCRIPTS.length; i++) {
48      var s = document.createElement('script');
49      s.src = EXPERIMENTATION_SCRIPTS[i];
50      s.type = 'text/javascript';
51      document.head.appendChild(s);
52    }
53  }
54
55  function installNoopHandler() {
56    var logged = false;
57    function handler() {
58      if (!logged) {
59        if (typeof window !== 'undefined' && window.console && typeof window.console.log === 'function') {
60          window.console.log("Experimentation setup skipped");
61        }
62        logged = true;
63      }
64      return Promise.resolve({ locations: [], error: 'Experimentation skipped: privacy consent not granted' });
65    }
66    function install() {
67      var opt = window.webShellClient && window.webShellClient.optimization;
68      if (!opt || typeof opt.setHandler !== 'function') return false;
69      opt.setHandler(handler);
70      return true;
71    }
72    if (!install()) {
73      var id;
74      var timeoutId = setTimeout(function () { clearInterval(id); }, 5000);
75      id = setInterval(function () {
76        if (install()) {
77          clearInterval(id);
78          clearTimeout(timeoutId);
79        }
80      }, 50);
81    }
82  }
83
84  if (checkBypassPrivacy()) {
85    loadExperimentationScripts();
86  } else {
87    installNoopHandler();
88  }
89})();

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.