o4-mini-2025-04-16· OpenAI
LMArena Human Preference 140K
Can you now make a piece of js to download all images on a page except gifs
- User
Can you now make a piece of js to download all images on a page except gifs
- Assistant
Here’s a tiny JavaScript grab-all (except GIFs) you can paste straight into your browser console (or turn into a bookmarklet). It finds every
<img>on the page, skips.giffiles, and “clicks” a download link for each.;(function downloadNonGifs(){ // 1) collect all <img> elements const imgs = Array.from(document.images) // 2) filter out GIFs (with or without query-strings) .filter(img => !/\.gif(\?.*)?$/i.test(img.src)); if (!imgs.length) { console.log('🔍 No non-GIF images found.'); return; } imgs.forEach((img, idx) => { // derive extension (jpg/png/webp/etc.) const url = img.src; const ext = url.split('.').pop().split(/[#?]/)[0] || 'jpg'; // create a temporary <a download> link and click it const a = document.createElement('a'); a.href = url; a.download = `image_${idx + 1}.${ext}`; document.body.appendChild(a); a.click(); document.body.removeChild(a); }); console.log(`✅ Started downloads for ${imgs.length} images.`); })();
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.