Generative artificial intelligence (GenAI) holds great promise for enhancing informal second language (L2) learning, but its impact largely depends on how it is used. This study explores the factors influencing L2 majors' intention to use GenAI for learning, based on the Theory of Planned Behavior (TPB). Data were collected from 668 L2 majors at various Chinese universities through an online questionnaire with six validated scales. Structural equation modeling (SEM) via AMOS 24 revealed several key findings. First, demographic factors (gender and age) did not significantly affect the TPB constructs. Second, subjective norm and attitude positively influenced behavioral intention, while perceived behavioral control did not have a significant effect, contrary to TPB predictions. Additionally, GenAI literacy was found to be a positive predictor of behavioral intention, both directly and indirectly through attitude. External beliefs positively influenced subjective norm, perceived behavioral control, and attitude, which in turn impacted behavioral intention, with mediation effects observed through subjective norm and attitude. However, perceived behavioral control did not mediate the relationship between external beliefs and behavioral intention. This study concludes by discussing implications and future directions.