Traffic exchanges: inside another site's frame, sign-in/join and off-site links open in a new tab (sign-in cookies are refused in frames)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-03 19:23:04 -05:00
parent b53de647b9
commit 563ece9896
21 changed files with 36 additions and 21 deletions
+11
View File
@@ -264,3 +264,14 @@ window.IAP = (function () {
function confirmBox(text, o) { return dialog(Object.assign({ type: 'none', text, ok: 'Yes', cancel: 'No' }, o || {})); }
return { getConfig, fmtPol, fmtUsd, status, renderNav, refreshNavWallet, describeEvent, feedRow, adSlot, reportAd, requestCode, launchChecks, launchToggle, ask, confirmBox, $ };
})();
// shown inside someone else's frame (traffic exchanges, 2026-10-03): sign-in, join and off-site links open in a new tab,
// because browsers refuse our session cookie inside another site's frame
(function () {
var framed = false; try { framed = window.top !== window.self; } catch (e) { framed = true; }
if (!framed) return;
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'; }
}, true);
})();