@@ -579,3 +579,56 @@ module.exports.setDefaultZoomLevel = (zoom) => {
579
579
ses . userPrefs . setDefaultZoomLevel ( zoom )
580
580
}
581
581
}
582
+
583
+ module . exports . addAutofillAddress = ( detail ) => {
584
+ let guidMap = { }
585
+ for ( let partition in registeredSessions ) {
586
+ let ses = registeredSessions [ partition ]
587
+ let guid = ses . autofill . addProfile ( {
588
+ full_name : detail . name ,
589
+ company_name : detail . organization ,
590
+ street_address : detail . streetAddress ,
591
+ city : detail . city ,
592
+ state : detail . state ,
593
+ postal_code : detail . postalCode ,
594
+ country_code : detail . country ,
595
+ phone : detail . phone ,
596
+ email : detail . email
597
+ } )
598
+ guidMap [ partition ] = guid
599
+ }
600
+ return guidMap
601
+ }
602
+
603
+ module . exports . removeAutofillAddress = ( guid ) => {
604
+ for ( let partition in registeredSessions ) {
605
+ let ses = registeredSessions [ partition ]
606
+ if ( guid [ partition ] !== undefined ) {
607
+ ses . autofill . removeProfile ( guid [ partition ] )
608
+ }
609
+ }
610
+ }
611
+
612
+ module . exports . addAutofillCreditCard = ( detail ) => {
613
+ let guidMap = { }
614
+ for ( let partition in registeredSessions ) {
615
+ let ses = registeredSessions [ partition ]
616
+ let guid = ses . autofill . addCreditCard ( {
617
+ name : detail . name ,
618
+ card_number : detail . card ,
619
+ expiration_month : detail . month ,
620
+ expiration_year : detail . year
621
+ } )
622
+ guidMap [ partition ] = guid
623
+ }
624
+ return guidMap
625
+ }
626
+
627
+ module . exports . removeAutofillCreditCard = ( guid ) => {
628
+ for ( let partition in registeredSessions ) {
629
+ let ses = registeredSessions [ partition ]
630
+ if ( guid [ partition ] !== undefined ) {
631
+ ses . autofill . removeCreditCard ( guid [ partition ] )
632
+ }
633
+ }
634
+ }
0 commit comments