PageSourceSearch

https://chatmls.ai/embed/offer.js

js chatmls.ai collected 2026-10-05 13:04:54 UTC 2,401 bytes, 50 lines download raw bytes

1(function () {
2  var me = document.currentScript || (function () {
3    var s = document.getElementsByTagName('script');
4    for (var i = s.length - 1; i >= 0; i--) { if (s[i].src && s[i].src.indexOf('offer.js') > -1) return s[i]; }
5    return null;
6  })();
7  if (!me || me.getAttribute('data-rw-embedded')) { return; }
8  me.setAttribute('data-rw-embedded', '1');
9
10  var origin;
11  try { origin = new URL(me.src).origin; } catch (e) { return; }
12
13  var slug = (me.getAttribute('data-slug') || '').trim();
14  if (!slug) { return; }
15  var variant = (me.getAttribute('data-variant') || 'card').trim().toLowerCase();
16  if (variant !== 'button') { variant = 'card'; }
17  var width = (me.getAttribute('data-width') || '').trim();
18
19  var q = ['embed=' + encodeURIComponent(variant)];
20  var p = me.getAttribute('data-p'); if (p) { q.push('p=' + encodeURIComponent(p)); }
21  var forName = me.getAttribute('data-for'); if (forName) { q.push('for=' + encodeURIComponent(forName)); }
22  // Affiliate pass-through: a promoter embeds the SAME offer with THEIR referral in the snippet
23  // (data-fpr="ref"). We forward it into the iframe URL as ?fpr=, where the offer page's FirstPromoter
24  // snippet tracks the click and the CTA carries it on to the hosted checkout. This is how per-embed
25  // attribution works — a cross-origin iframe can't read the host page's own ?fpr cookie/param.
26  var fpr = me.getAttribute('data-fpr') || me.getAttribute('data-aff');
27  if (fpr) { q.push('fpr=' + encodeURIComponent(fpr)); }
28  var src = origin + '/offer/' + encodeURIComponent(slug) + '?' + q.join('&');
29
30  var frame = document.createElement('iframe');
31  frame.src = src;
32  frame.title = 'Real Wave offer';
33  frame.setAttribute('loading', 'lazy');
34  frame.style.border = '0';
35  frame.style.width = width || '100%';
36  frame.style.maxWidth = '480px';
37  frame.style.height = (variant === 'button' ? 72 : 460) + 'px';
38  frame.style.display = 'block';
39  frame.style.transition = 'height .2s ease';
40  me.parentNode.insertBefore(frame, me.nextSibling);
41
42  // Auto-size to content — accept only messages from OUR origin, for THIS slug.
43  window.addEventListener('message', function (ev) {
44    if (ev.origin !== origin) { return; }
45    var d = ev.data;
46    if (!d || d.type !== 'rw-offer-embed' || d.slug !== slug) { return; }
47    var h = parseInt(d.height, 10);
48    if (h > 0 && h < 4000) { frame.style.height = h + 'px'; }
49  });
50})();

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.