PageSourceSearch

https://www.fanzine.com/js/snack_ads.js?v=1790955390

js fanzine.com collected 2026-10-02 15:36:37 UTC 7,850 bytes, 283 lines download raw bytes

1window.addEventListener('locationchange', function () {
2	// findAndInitializeAds();
3	refreshAds();
4	console.log('onlocationchange');
5})
6$(document).ready(function () {
7	// findAndInitializeAds();
8	initAds();
9	initRecommendationUnits();
10});
11$(window).on('load', function () {
12	// refreshAds();
13	// findAndInitializeAds();
14	initRecommendationUnits();
15	console.log('onload');
16});
17
18function initGoogleAdManagerAds() {
19	/* <![CDATA[ */
20	(function (document, window) {
21		var a, c = document.createElement("script"), f = window.frameElement;
22
23		c.id = "CleverCoreLoader77847";
24		c.src = "https://scripts.cleverwebserver.com/1f6dd5f6d110719e1d16aa6b46eb97d7.js";
25
26		c.async = !0;
27		c.type = "text/javascript";
28		c.setAttribute("data-target", window.name || (f && f.getAttribute("id")));
29		c.setAttribute("data-callback", "put-your-callback-function-here");
30		c.setAttribute("data-callback-url-click", "put-your-click-macro-here");
31		c.setAttribute("data-callback-url-view", "put-your-view-macro-here");
32
33
34		try {
35			a = parent.document.getElementsByTagName("script")[0] || document.getElementsByTagName("script")[0];
36		} catch (e) {
37			a = !1;
38		}
39
40		a || (a = document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]);
41		a.parentNode.insertBefore(c, a);
42	})(document, window);
43	/* ]]> */
44}
45
46function initAds() {
47
48	let site_id = 2536;
49	let data_site_id = 0;
50
51	let sn_cb = new Date().getMonth();
52	let snack_hb = document.createElement('script');
53	snack_hb.src = 'https://cdn-header-bidding.snack-media.com/assets/js/snack-loader/' + site_id + '?cb=' + sn_cb;
54	snack_hb.id = 'snack_ads';
55	if (data_site_id) {
56		snack_hb.setAttribute('data-site-id', data_site_id);
57	}
58	document.body.appendChild(snack_hb);
59	snack_hb.onerror = function () {
60		document.body.removeChild(snack_hb);
61		let snack_hb2 = document.createElement('script');
62		snack_hb2.src = 'https://cdn2-header-bidding.snack-media.com/assets/js/snack-loader/' + site_id + '?cb=' + sn_cb;
63		snack_hb2.id = 'snack_ads';
64		if (data_site_id) {
65			snack_hb2.setAttribute('data-site-id', data_site_id);
66		}
67		document.body.appendChild(snack_hb2);
68	};
69}
70
71function initRecommendationUnits() {
72	window._taboola = window._taboola || [];
73	_taboola.push({
74		article: 'auto',
75		/*url: window.location.href,
76		mode: 'thumbnails-a',
77		container: 'taboola-below-article-thumbnails-1',
78		placement: 'Below Article Thumbnails 1',
79		target_type: 'mix'*/
80	});
81	!function (e, f, u, i) {
82		if (!document.getElementById(i)) {
83			e.async = 1;
84			e.src = u;
85			e.id = i;
86			f.parentNode.insertBefore(e, f);
87		}
88	}(document.createElement('script'),
89		document.getElementsByTagName('script')[0],
90		'//cdn.taboola.com/libtrc/snackmedianew-network/loader.js',
91		'tb_loader_script');
92	if (window.performance && typeof window.performance.mark == 'function') {
93		window.performance.mark('tbl_ic');
94	}
95}
96
97function findAndInitializeAds() {
98	let ele = document.getElementsByClassName('clever-core-ads');
99	/*let ele = document.getElementById('snack_ldb');
100	let ele1 = document.getElementById('snack_mob_top');
101	let ele2 = document.getElementById('snack_dex3');
102	let dex4 = document.getElementById('snack_dex4');
103	let dex5 = document.getElementById('snack_dex5');
104	let dex6 = document.getElementById('snack_dex6');
105	let dex7 = document.getElementById('snack_dex7');
106	let dex8 = document.getElementById('snack_dex8');
107
108	let mex3 = document.getElementById('snack_mex3');
109	let mex4 = document.getElementById('snack_mex4');
110	let mex5 = document.getElementById('snack_mex5');
111	let mex6 = document.getElementById('snack_mex6');
112	let mex7 = document.getElementById('snack_mex7');
113	let mex8 = document.getElementById('snack_mex8');*/
114	let adInterval = setInterval(function () {
115		console.log('checkLoaded2', ele);
116		// if (ele || ele1 || ele2 || dex4 || dex5 || dex6 || dex7 || mex3 || mex4 || mex5 || mex6 || mex7 || mex8) {
117		if (ele.length > 0) {
118			initGoogleAdManagerAds();
119			/*if (action === 'refresh') {
120				refreshAds();
121			}*/
122			clearInterval(adInterval);
123		}
124		ele = document.getElementsByClassName('clever-core-ads');
125		/*ele = document.getElementById('snack_ldb');
126		ele1 = document.getElementById('snack_mob_top');
127		ele2 = document.getElementById('snack_dex3');
128		dex4 = document.getElementById('snack_dex4');
129		dex5 = document.getElementById('snack_dex5');
130		dex6 = document.getElementById('snack_dex6');
131		dex7 = document.getElementById('snack_dex7');
132		dex8 = document.getElementById('snack_dex8');
133		mex3 = document.getElementById('snack_mex3');
134		mex4 = document.getElementById('snack_mex4');
135		mex5 = document.getElementById('snack_mex5');
136		mex6 = document.getElementById('snack_mex6');
137		mex7 = document.getElementById('snack_mex7');
138		mex8 = document.getElementById('snack_mex8');*/
139	}, 10);
140}
141
142let adInterval = {};
143let adIntervalCount = {};
144
145function findAndInitializeAdUnit(unitName) {
146	let unit = document.getElementById(unitName);
147	adIntervalCount[unitName] = 0;
148	adInterval[unitName] = setInterval(function () {
149		if (unit || adIntervalCount[unitName] === 5000) {
150			if (unit) {
151				refreshAdUnit(unitName);
152			}
153			clearInterval(adInterval[unitName]);
154		}
155		unit = document.getElementById(unitName);
156		adIntervalCount[unitName]++;
157	}, 10);
158}
159
160function refreshAdUnit(unitName) {
161	try {
162		killSlot([unitName]);
163		refreshBid([unitName]);
164	} catch (e) {
165	}
166}
167
168function refreshAds() {
169	try {
170		// killSlot(['snack_dex3']);
171		// refreshBid(['snack_dex3']);
172		findAndInitializeAdUnit('snack_dex3');
173	} catch (e) {
174	}
175	try {
176		// killSlot(['snack_dex4']);
177		// refreshBid(['snack_dex4']);
178		findAndInitializeAdUnit('snack_dex4');
179	} catch (e) {
180	}
181	try {
182		// killSlot(['snack_dex5']);
183		// refreshBid(['snack_dex5']);
184		findAndInitializeAdUnit('snack_dex5');
185	} catch (e) {
186	}
187	try {
188		// killSlot(['snack_dex6']);
189		// refreshBid(['snack_dex6']);
190		findAndInitializeAdUnit('snack_dex6');
191	} catch (e) {
192	}
193	try {
194		// killSlot(['snack_dex7']);
195		// refreshBid(['snack_dex7']);
196		findAndInitializeAdUnit('snack_dex7');
197	} catch (e) {
198	}
199	try {
200		// killSlot(['snack_dex8']);
201		// refreshBid(['snack_dex8']);
202		findAndInitializeAdUnit('snack_dex8');
203	} catch (e) {
204	}
205	try {
206		// killSlot(['snack_dex9']);
207		// refreshBid(['snack_dex9']);
208		findAndInitializeAdUnit('snack_dex9');
209	} catch (e) {
210	}
211	try {
212		// killSlot(['snack_dex10']);
213		// refreshBid(['snack_dex10']);
214		findAndInitializeAdUnit('snack_dex10');
215	} catch (e) {
216	}
217	try {
218		// killSlot(['snack_dex11']);
219		// refreshBid(['snack_dex11']);
220		findAndInitializeAdUnit('snack_dex11');
221	} catch (e) {
222	}
223	try {
224		// killSlot(['snack_dex12']);
225		// refreshBid(['snack_dex12']);
226		findAndInitializeAdUnit('snack_dex12');
227	} catch (e) {
228	}
229	try {
230		// killSlot(['snack_dex13']);
231		// refreshBid(['snack_dex13']);
232		findAndInitializeAdUnit('snack_dex13');
233	} catch (e) {
234	}
235	try {
236		// killSlot(['snack_dex14']);
237		// refreshBid(['snack_dex14']);
238		findAndInitializeAdUnit('snack_dex14');
239	} catch (e) {
240	}
241	try {
242		// killSlot(['snack_ldb']);
243		// refreshBid(['snack_ldb']);
244		findAndInitializeAdUnit('snack_ldb');
245	} catch (e) {
246	}
247	try {
248		// killSlot(['snack_mob_top']);
249		// refreshBid(['snack_mob_top']);
250		findAndInitializeAdUnit('snack_mob_top');
251	} catch (e) {
252	}
253	try {
254		// killSlot(['snack_mob_mid']);
255		// refreshBid(['snack_mob_mid']);
256		findAndInitializeAdUnit('snack_mob_mid');
257	} catch (e) {
258	}
259	try {
260		// killSlot(['snack_mob_bot']);
261		// refreshBid(['snack_mob_bot']);
262		findAndInitializeAdUnit('snack_mob_bot');
263	} catch (e) {
264	}
265	try {
266		// killSlot(['snack_mpu']);
267		// refreshBid(['snack_mpu']);
268		findAndInitializeAdUnit('snack_mpu');
269	} catch (e) {
270	}
271	try {
272		// killSlot(['snack_dmpu']);
273		// refreshBid(['snack_dmpu']);
274		findAndInitializeAdUnit('snack_dmpu');
275	} catch (e) {
276	}
277	try {
278		// killSlot(['snack_dex1']);
279		// refreshBid(['snack_dex1']);
280		findAndInitializeAdUnit('snack_dex1');
281	} catch (e) {
282	}
283}

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.