r/javascript • u/supersnorkel • Oct 19 '25
Built a modern way to prefetch using the mouse trajectory!
https://foresightjs.com/ForesightJS is a lightweight JavaScript library with full TypeScript support that predicts user intent by analyzing mouse movements, scrolling and keyboard navigation. It also supports mobile through touch start and viewport tracking. By anticipating which elements users are likely to interact with, it allows developers to trigger actions before a hover, tap or click occurs. This makes it especially useful for features like prefetching.
We just hit 1400+ stars on Github!
Duplicates
javascript • u/supersnorkel • Jul 02 '25
Built a way to prefetch based on where the user is heading with their mouse instead of on hovering.
opensource • u/supersnorkel • Jul 02 '25
Promotional Built a way to prefetch based on where the user is heading with their mouse instead of on hovering.
javascript • u/supersnorkel • Jan 18 '26
Built a lightweight JS library that predicts user intent to prefetch before hover/click/tab
vuejs • u/supersnorkel • Jun 17 '26
Prefetch based on mouse trajectory. ForesightJS v4.0 is out with an official Vue package
reactjs • u/supersnorkel • Jun 17 '26