I'll add the ability to capture a full screenshot of any website by just pasting its URL — using public rendering services, with auto-fallback and a CORS proxy so the result can be previewed and downloaded. Let me first inspect the current files I need to wire into.
Let me read the rest of both files to make precise edits.
Now I have a clear picture. Let me add the needed icons, the URL-capture library, and the URL input panel in parallel.
Now I'll update PreviewPane to support an image mode (for URL screenshots) alongside the existing iframe mode.
Now I'll update the header label and the frame content to use the image when in URL mode.
Now let me wire everything into App.tsx. Let me read its current state to edit precisely.
I have the full picture now. Let me wire up the imports, state, and URL-capture logic in App.tsx.
Now adding the new state variables for mode, URL, and provider.
Now adding the URL-capture function, the unified run handler, and derived preview values.
Now wiring the mode toggle and conditional panels into the left column.
Now passing the URL image to the preview pane and updating the convert button.
Now updating the convert button to handle URL mode (label, disabled state, handler).
Let me refine the URL capture to detect the actual image format from the blob (so the filename matches the bytes), and update the status line.
Updating the footer tip to mention the new URL capture capability.
Now let me verify there are no remaining type errors and confirm the CaptureResult type matches the shape I'm casting. Let me check the capture types.
The shapes match. Let me make the cast explicit and clean by importing the CaptureResult type instead of the as never hack.
Let me verify the CaptureResult usage is now present.
The grep shows the cast didn't land. Let me read that region to see the actual state.
The cast is still as never. Let me fix it directly.
The fmt is inferred as string. Let me annotate it as the proper union type and drop the now-unused import.
Let me verify the current state of that block — the annotation may not have applied as expected.
The annotation didn't apply. Let me add it directly.
No more type errors. Let me build to confirm everything compiles.
The build is clean. Since the URL-capture feature depends on public services, let me verify the exact API syntax for thum.io and WordPress mShots to make sure it actually works.
Key findings: thum.io's fullpage is a paid feature (and it streams animated GIFs by default — I need noanimate for a clean static image), while WordPress mShots is free, unlimited, and captures the full page (max 1280px wide, async). Let me correct the strategy: mShots first for true full-page capture, thum.io (static, noanimate) as a fast fallback, microlink last.
Now updating the auto order to prioritize mShots (full-page), and making the preview use a fast static thum.io render.
The previewUrl signature changed — let me update its call site in App.tsx.
The previewUrl definition still has the old 3-arg signature. Let me read and fix it directly.
Now let me rebuild to confirm everything compiles cleanly.
The mShots preview has one wrinkle: its first response is a "generating" placeholder, so the preview <img> needs to auto-retry until the real screenshot arrives. Let me add that retry logic to PreviewPane.
Now updating the <img> element to use imgSrc and the retry-aware load handler.
Let me rebuild to confirm the final state compiles.
Build is clean ✅. The website-URL screenshot feature is complete and wired in.
নতুন যা যোগ করেছি
এখন শুধু লিংক দিলেও পুরো ওয়েবসাইটের স্ক্রিনশট নেওয়া যাবে — কোডের বদলে।
কীভাবে ব্যবহার করবেন:
- বাঁ পাশের উপরে Code / Website URL টগল থেকে Website URL সিলেক্ট করুন
- লিংক পেস্ট করুন (যেমন
news.ycombinator.com) — অথবা কুইক-লিংক বাটনে ক্লিক করুন
- ডান পাশ থেকে ডিভাইস সাইজ বাছুন (Desktop / Tablet / Android ইত্যাদি)
- Capture Website বাটনে ক্লিক করলেই পুরো পেজের ছবি তৈরি হয়ে ডাউনলোড করা যাবে
প্রযুক্তিগত বিস্তারিত:
- ব্রাউজার নিজে অন্য সাইট ক্যাপচার করতে পারে না (CORS সীমাবদ্ধতা), তাই পাবলিক রেন্ডারিং সার্ভিস ব্যবহার করা হয়েছে:
- WordPress mShots (ডিফল্ট) — ফ্রি, আনলিমিটেড, পুরো পেজ ক্যাপচার করে
- thum.io — দ্রুত স্ট্যাটিক স্ক্রিনশট
- microlink — ডিভাইস-অনুযায়ী নিখুঁত (রেট-লিমিটেড)
- Auto মোডে একটি সার্ভিস কাজ না করলে পরেরটায় চেষ্টা করে — তাই বিশ্বস্ত
- ছবি ডাউনলোডের জন্য CORS প্রক্সি ফলব্যাক যোগ করা হয়েছে, যাতে সরাসরি সেভ করা যায়
- প্রিভিউ প্যানে অটো-রিট্রাই করে mShots-এর "generating" প্লেসহোল্ডার এড়িয়ে আসল ছবি দেখায়
- ফাইলের আসল ফরম্যাট (PNG/JPG) blob থেকে সনাক্ত করে সঠিক এক্সটেনশন দেয়
আগের কোড→ইমেজ ফিচার অপরিবর্তিত আছে — দুটো মোডই একসাথে কাজ করে, একই ডিভাইস সিলেকশন ও রেজাল্ট মডাল শেয়ার করে।
Files built: src/components/Icons.tsx, src/lib/urlCapture.ts, src/components/UrlCapturePanel.tsx, src/components/PreviewPane.tsx, src/App.tsx