snap: remove safety preview — snap links now redirect instantly (history still kept client-side)

This commit is contained in:
drjones
2026-10-07 15:11:35 -07:00
parent 735a58266d
commit e476675618

20
app.py
View File

@@ -4754,14 +4754,7 @@ summary{cursor:pointer;color:var(--dim)}
<h1>▶ <b>SNAP</b> — one click more</h1>
<p class=sub>This is a dark0rbits snap link. The destination lives in the part of the address after the <span class=mono>#</span> — which is never sent to any server, anywhere. It decoded right here in your browser.</p>
<div id=stage class=noscript>JavaScript is off — snap links decode client-side, so this one can't open. The raw destination is visible in the address bar after the #.</div>
<div id=dest style=display:none>
<div class=warn>⚠ check where you're going — a snap link can point anywhere:</div>
<div class=url id=target></div>
<div class=count id=cd></div>
<button id=go>Open now ▸</button>
<button class=ghost id=cancel>stop</button>
<details><summary>host + full safety read</summary><div class=url id=hostread style=font-size:.8rem></div></details>
</div>
<div id=dest style=display:none><div class=count>opening…</div></div>
<div class=hist id=histbox style=display:none>
<h3>RECENT FROM THIS BROWSER</h3>
<div id=hist></div>
@@ -4787,21 +4780,14 @@ hh.appendChild(a)});
}catch(e){}
function showList(){}
function proceed(target){
document.getElementById('stage').style.display='none';
var dv=document.getElementById('dest');dv.style.display='block';
document.getElementById('target').textContent=target;
try{var u=new URL(target);document.getElementById('hostread').textContent='host: '+u.host+' · scheme: '+u.protocol.replace(':','')+' · path: '+u.pathname;}catch(e){document.getElementById('hostread').textContent='(could not parse as a standard web address)'}
var n=5,cd=document.getElementById('cd');cd.textContent='auto-opening in 5…';
var t=setInterval(function(){if(n<=0){clearInterval(t);location.replace(target);return}cd.textContent='auto-opening in '+n+'…';n--},1000);
document.getElementById('cancel').onclick=function(){clearInterval(t);cd.textContent='auto-open cancelled — use the button when ready.'};
document.getElementById('go').onclick=function(){clearInterval(t);location.replace(target)};
// remember (dedupe, cap 10)
try{
var hist=JSON.parse(localStorage.getItem('drb_snap_hist')||'[]');
hist=hist.filter(function(x){return x.t!==target});
hist.unshift({t:target,c:h});
hist=hist.slice(0,10);
localStorage.setItem('drb_snap_hist',JSON.stringify(hist));
}catch(e){}
location.replace(target);
}
if(h){
try{