Given the close connection between eye movement and frontal lobe functions and some evidence supporting the effect of eye-tracking training on enhancing cognitive performance mediated by the frontal lobe, this study aimed to explore if after-school eye-tracking training can improve the visuospatial working memory (VSWM) and cognitive flexibility performance in children with attention-deficit/hyperactivity disorder (ADHD) and autism spectrum disorder (ASD). This study is a non-randomized cluster trial. Forty children from eight primary schools were selected, half receiving eye-tracking training for 20 sessions over 9 months, while the other half served as a waitlist control. They were matched on demographic characteristics and baseline cognitive performance. Their VSWM and cognitive flexibility were assessed at the beginning and end of the study. Results showed that children who received eye-tracking training, but not those on a waitlist, exhibited significant improvements in the total score and working memory span of the VSWM tests, and the correct responses in cognitive flexibility tests. Specifically, VSWM performance at higher span levels (5 or above) yielded a greater improvement. The findings suggest that eye-tracking training can be a feasible and effective after-school program for improving working memory and cognitive flexibility performance in children with ADHD and ASD. This study was prospectively registered at ClinicalTrials.gov (https://clinicaltrials.gov/, trial number: NCT05428657).