@@ -80,9 +80,26 @@ validateWithIndicator(nameInputEl, {
8080 } ,
8181} ) ;
8282
83+ // Variable to store the disposable email module and loading state
84+ let disposableEmailModule : any = null ;
85+ let moduleLoadAttempted = false ;
86+
8387const emailInputEl = document . querySelector (
8488 ".page.pageLogin .register.side input.emailInput"
8589) as HTMLInputElement ;
90+
91+ // Add focus event listener to dynamically import disposable email package
92+ emailInputEl . addEventListener ( "focus" , async ( ) => {
93+ if ( ! moduleLoadAttempted ) {
94+ moduleLoadAttempted = true ;
95+ try {
96+ disposableEmailModule = await import ( "disposable-email-domains-js" ) ;
97+ } catch ( e ) {
98+ // Silent failure as requested - don't throw or notify user
99+ }
100+ }
101+ } ) ;
102+
86103validateWithIndicator ( emailInputEl , {
87104 schema : UserEmailSchema ,
88105 isValid : async ( email : string ) => {
@@ -103,6 +120,20 @@ validateWithIndicator(emailInputEl, {
103120 warning : "Please check your email address, it may contain a typo." ,
104121 } ;
105122 }
123+
124+ // Check for temporary/disposable email
125+ if ( disposableEmailModule && disposableEmailModule . isDisposableEmail ) {
126+ try {
127+ if ( disposableEmailModule . isDisposableEmail ( email ) ) {
128+ return {
129+ warning : "Be careful when using temporary emails - you will need it to log into your account" ,
130+ } ;
131+ }
132+ } catch ( e ) {
133+ // Silent failure - if the check fails, continue with validation
134+ }
135+ }
136+
106137 return true ;
107138 } ,
108139 debounceDelay : 0 ,
0 commit comments