diff --git a/public/admin.html b/public/admin.html index 5eb7ac3..c718c55 100644 --- a/public/admin.html +++ b/public/admin.html @@ -511,7 +511,7 @@ - + diff --git a/public/assets/common.js b/public/assets/common.js index 2cbbc45..732ffea 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -269,9 +269,15 @@ window.IAP = (function () { (function () { var framed = false; try { framed = window.top !== window.self; } catch (e) { framed = true; } if (!framed) return; + // the sponsor this page was opened for (?ref=, /join/, /wall/); its cookie was refused in the frame, so the + // new tab gets it in the link and the viral-link rule sets it there + var ref = ''; try { ref = new URLSearchParams(location.search).get('ref') || (location.pathname.match(/^\/(?:join|wall)\/([^/?#]+)/) || [])[1] || ''; } catch (e) {} + ref = String(ref).toLowerCase().replace(/[^a-z0-9_]/g, '').slice(0, 20); document.addEventListener('click', function (e) { var a = e.target && e.target.closest && e.target.closest('a[href]'); if (!a) return; var h = a.getAttribute('href') || ''; if (h.charAt(0) === '#' || /^javascript:/i.test(h)) return; - if (a.host !== location.host || /^\/(my|join|signin|login|from|admin)(\/|$)/.test(a.pathname)) { a.target = '_blank'; a.rel = 'noopener'; } + var sign = a.host === location.host && /^\/(my|join|signin|login|from|admin)(\/|$)/.test(a.pathname); + if (sign && ref && a.pathname === '/my' && !/[?&]ref=/.test(a.search)) a.search = (a.search ? a.search + '&' : '?') + 'ref=' + ref; + if (sign || a.host !== location.host) { a.target = '_blank'; a.rel = 'noopener'; } }, true); })(); diff --git a/public/contract.html b/public/contract.html index 82ed301..f0fbb36 100644 --- a/public/contract.html +++ b/public/contract.html @@ -141,7 +141,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.
- + diff --git a/public/disclaimer.html b/public/disclaimer.html index 32af4af..72372e1 100644 --- a/public/disclaimer.html +++ b/public/disclaimer.html @@ -26,7 +26,7 @@

You decide whether, and how much, to spend. Never spend more than you can afford to lose.

- + diff --git a/public/earning.html b/public/earning.html index a3a8da9..b56fae4 100644 --- a/public/earning.html +++ b/public/earning.html @@ -83,6 +83,6 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/friday.html b/public/friday.html index f8353e0..08ed6bb 100644 --- a/public/friday.html +++ b/public/friday.html @@ -70,6 +70,6 @@ - + diff --git a/public/index.html b/public/index.html index d0d0b05..36ca7d3 100644 --- a/public/index.html +++ b/public/index.html @@ -497,7 +497,7 @@ - + diff --git a/public/join.html b/public/join.html index f138f37..12dcb3f 100644 --- a/public/join.html +++ b/public/join.html @@ -157,7 +157,7 @@ InstantAdPay · Contract · Terms · Privacy · Disclaimer - + diff --git a/public/launch.html b/public/launch.html index e1f2b65..5118fa7 100644 --- a/public/launch.html +++ b/public/launch.html @@ -104,7 +104,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees.
- + diff --git a/public/ledger.html b/public/ledger.html index 69f1f4e..d3b38a9 100644 --- a/public/ledger.html +++ b/public/ledger.html @@ -39,7 +39,7 @@
InstantAdPay · how it works · contract source ↗
- + diff --git a/public/my.html b/public/my.html index 0289d3b..cbafa45 100644 --- a/public/my.html +++ b/public/my.html @@ -1126,7 +1126,7 @@ - + diff --git a/public/partners.html b/public/partners.html index 358cc05..7c26f32 100644 --- a/public/partners.html +++ b/public/partners.html @@ -128,7 +128,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford to lose.
- + diff --git a/public/plays.html b/public/plays.html index 1fc2f07..3867953 100644 --- a/public/plays.html +++ b/public/plays.html @@ -192,7 +192,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never spend what you cannot afford.
- + diff --git a/public/privacy.html b/public/privacy.html index ce8a10a..d5c8508 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -29,7 +29,7 @@

We use reasonable safeguards, but no system is perfectly secure. Protect your email and your wallet.

- + diff --git a/public/terms.html b/public/terms.html index 244daa1..4f87830 100644 --- a/public/terms.html +++ b/public/terms.html @@ -38,7 +38,7 @@

See also the Disclaimer and Privacy Policy.

- + diff --git a/public/tx.html b/public/tx.html index c3a1417..cbc4bd3 100644 --- a/public/tx.html +++ b/public/tx.html @@ -34,7 +34,7 @@

← Back to the live ledger · Read the contract review

- + diff --git a/public/wall.html b/public/wall.html index 5bd1ca9..d8d0aef 100644 --- a/public/wall.html +++ b/public/wall.html @@ -47,7 +47,7 @@ - + diff --git a/public/wallets.html b/public/wallets.html index 4df3d73..fb2a406 100644 --- a/public/wallets.html +++ b/public/wallets.html @@ -121,7 +121,7 @@
Advertising services with a performance referral program. Not an investment product; no income guarantees. Crypto transactions are irreversible. Never share your recovery phrase.
- + diff --git a/public/wednesday.html b/public/wednesday.html index 419a006..8ff5160 100644 --- a/public/wednesday.html +++ b/public/wednesday.html @@ -63,6 +63,6 @@ - + diff --git a/server.js b/server.js index 1ce86ab..38621a3 100644 --- a/server.js +++ b/server.js @@ -4217,7 +4217,7 @@ const server = http.createServer(async (req, res) => { + '' + '
' + esc(label) + ' badge for @' + esc(un) + '

@' + esc(un) + ' unlocked ' + label + '

' + esc(sub.charAt(0).toUpperCase() + sub.slice(1)) + '. On InstantAdPay every ad package that sells pays the sponsor in the same transaction, straight to their wallet, on-chain.

' + 'Join @' + esc(un) + '\u2019s line free

Advertising with a performance referral program. Not an investment; no income is guaranteed.

' - + ''; + + ''; res.writeHead(200, baseHeaders({ 'Content-Type': 'text/html; charset=utf-8', 'Cache-Control': 'public, max-age=300' })); return res.end(html); }