PageSourceSearch

https://safety.snipershopping.com/shared/js/content.js

js snipershopping.com collected 2026-10-06 10:32:49 UTC 2,395 bytes, 51 lines download raw bytes

1/* Sniper - storefront content edited in Admin > Storefront.
2   window.SNIPER_CONTENT (shared/js/business-data.js, from the database) holds
3   only what was changed; everything else keeps the value in this site's
4   assets/js/config.js. Loaded right after config.js, before anything reads it.
5     featured   Sniper Safety's homepage product row (product ids, in order)
6     rows       homepage rows: { newest: [ids] (both sites), popular: [ids] (Sniper Shopping) }
7     hero       homepage picture / video
8     blocks     rows of icon + text (heroStrip, pdpTrust)
9     sections   per category: banner picture + focal point, description
10     recommend  "You may also like": per category or per product - ids or "off" */
11(function () {
12  "use strict";
13  var C = window.SNIPER_CONTENT;
14  if (!C || typeof C !== "object") return;
15
16  if (Array.isArray(C.featured)) window.SNIPER_FEATURED = C.featured.slice();
17  if (C.rows) window.SNIPER_HOME_ROWS = C.rows;   // pinned products: New arrivals (both sites), Popular (Sniper Shopping)
18  if (C.hero && C.hero.type) window.SNIPER_HERO = C.hero;
19
20  if (C.blocks) {
21    window.SNIPER_BLOCKS = window.SNIPER_BLOCKS || {};
22    Object.keys(C.blocks).forEach(function (k) { window.SNIPER_BLOCKS[k] = C.blocks[k]; });
23  }
24
25  var META = window.SNIPER_SECTION_META || {};
26  Object.keys(C.sections || {}).forEach(function (k) {
27    var s = C.sections[k], m = META[k];
28    if (!m) return;
29    if (s.banner && s.banner.src) m.banner = { src: s.banner.src, pos: s.banner.pos || "50% 50%" };
30    if (typeof s.blurb === "string" && s.blurb) m.blurb = s.blurb;
31    if (typeof s.blurbAr === "string" && s.blurbAr) m.blurbAr = s.blurbAr;
32  });
33
34  if (C.recommend) {
35    var R = window.SNIPER_RECOMMEND = window.SNIPER_RECOMMEND || { section: {}, product: {} };
36    ["section", "product"].forEach(function (lvl) {
37      R[lvl] = R[lvl] || {};
38      Object.keys((C.recommend || {})[lvl] || {}).forEach(function (k) { R[lvl][k] = C.recommend[lvl][k]; });
39    });
40  }
41
42  /* Sniper Safety's homepage picture is part of its HTML: swap it once the page is there */
43  if (C.hero && C.hero.type === "image" && C.hero.src) {
44    var swap = function () {
45      var img = document.querySelector(".hero__media img");
46      if (img) img.src = C.hero.src;
47    };
48    if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", swap);
49    else swap();
50  }
51})();

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.