Intelligently preload images in carousels for faster navigation
Description
Intelligently preload images in carousels and sliders for faster, seamless navigation. This script eliminates the frustrating wait time when clicking through image galleries, product showcases, and slideshow sections.
How It Works
The script automatically detects carousels on any website and predictively preloads adjacent images before you navigate to them. When you click the next/previous arrow, swipe on mobile, or use keyboard navigation, the images are already cached and display instantly.
Features
<img> tags and CSS background imagesConfiguration
Open the script and adjust these values to customize behavior:
PRELOAD_BUFFER (default: 3) - Number of images to preload ahead/behind current. Higher = faster navigation but more bandwidthPRELOAD_DELAY (default: 500ms) - Delay before preloading triggers after navigation. Adjust if carousels transition slowlyDEBUG (default: false) - Set to true to see console logs for troubleshootingPerformance
Noticeable improvement on sites with:
Compatibility
Notes
The script uses the browser's native image caching, so it only downloads images once. Preloaded images are cached locally and reused when you navigate back to them.
License
GPLv3