From db1fa8d506f72149351099063346f7b1cfe963c1 Mon Sep 17 00:00:00 2001 From: SnapAPI Agent Date: Sun, 22 Feb 2026 08:52:32 +0000 Subject: [PATCH] fix: privacy 404 + enhanced playground controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG-010: Add 301 redirects for clean URLs (/privacy → /privacy.html etc.) and fix inconsistent href links across legal pages. FEATURE: Enhanced playground with fullPage, quality, deviceScale, waitUntil, and waitForSelector controls for better API evaluation. --- public/impressum.html | 6 ++--- public/index.html | 58 ++++++++++++++++++++++++++++++++++------ public/privacy.html | 6 ++--- public/terms.html | 8 +++--- src/index.ts | 5 ++++ src/routes/playground.ts | 18 ++++++++++--- 6 files changed, 79 insertions(+), 22 deletions(-) diff --git a/public/impressum.html b/public/impressum.html index 182e3cc..8872189 100644 --- a/public/impressum.html +++ b/public/impressum.html @@ -162,9 +162,9 @@ footer{border-top:1px solid var(--border);padding:48px 24px 32px;background:var( -
- - +
+
+ + +
+
+ + +
@@ -320,6 +326,34 @@ footer{border-top:1px solid var(--border);padding:48px 24px 32px;background:var(
+
+
+ + +
+
+ + +
+
+
+ +
+
+ + +
@@ -632,8 +666,13 @@ footer{border-top:1px solid var(--border);padding:48px 24px 32px;background:var( async function runPlayground(){ var url=document.getElementById('pg-url').value; var format=document.getElementById('pg-format').value; + var quality=parseInt(document.getElementById('pg-quality').value)||80; var width=parseInt(document.getElementById('pg-width').value)||1280; var height=parseInt(document.getElementById('pg-height').value)||800; + var fullPage=document.getElementById('pg-fullpage').checked; + var deviceScale=parseInt(document.getElementById('pg-scale').value)||1; + var waitUntil=document.getElementById('pg-waituntil').value; + var waitForSelector=document.getElementById('pg-selector').value.trim()||undefined; if(!url){alert('Please enter a URL');return} var btn=document.getElementById('pg-btn'); @@ -646,11 +685,14 @@ async function runPlayground(){ placeholder.style.display='none';result.style.display='none';error.style.display='none'; loading.style.display='flex'; + var body={url:url,format:format,width:width,height:height,fullPage:fullPage,quality:quality,deviceScale:deviceScale,waitUntil:waitUntil}; + if(waitForSelector)body.waitForSelector=waitForSelector; + try{ var r=await fetch('/v1/playground',{ method:'POST', headers:{'Content-Type':'application/json'}, - body:JSON.stringify({url:url,format:format,width:width,height:height}) + body:JSON.stringify(body) }); if(!r.ok){var d=await r.json().catch(function(){return{}});throw new Error(d.error||'HTTP '+r.status)} var blob=await r.blob(); diff --git a/public/privacy.html b/public/privacy.html index 9b478bb..5741a90 100644 --- a/public/privacy.html +++ b/public/privacy.html @@ -298,9 +298,9 @@ footer{border-top:1px solid var(--border);padding:48px 24px 32px;background:var(