@@ -128,6 +128,7 @@ function store_get(keys) {
128128 'passwdtimeout' : xul . passwdtimeout ,
129129 'pass_store' : xul . pass_store ,
130130 'pass_to_clipboard' : xul . pass_to_clipboard ,
131+ 'auto_submit_pass' : xul . auto_submit_pass ,
131132 'hotkeycombo' : xul . hotkeycombo ,
132133 'max_alg_version' : xul . max_alg_version
133134 } ;
@@ -143,6 +144,7 @@ function store_get(keys) {
143144 case 'passwdtimeout' :
144145 case 'pass_store' :
145146 case 'pass_to_clipboard' :
147+ case 'auto_submit_pass' :
146148 case 'hotkeycombo' :
147149 case 'max_alg_version' :
148150 r [ k ] = settings [ k ] ;
@@ -238,8 +240,12 @@ function update_page_password(pass, allow_subframe) {
238240 if ( ! allow_subframe && r . frameId )
239241 throw new Update_pass_failed ( "Not pasting to subframe" ) ;
240242
243+ let code = 'document.activeElement.value = ' + JSON . stringify ( pass ) + '; document.activeElement.dispatchEvent(new Event("change", {bubbles: true, cancelable: true}));' ;
244+ if ( settings . auto_submit_pass )
245+ code += '(document.activeElement.form && window.setTimeout(()=>{document.activeElement.form.dispatchEvent(new Event("submit", {bubbles: true, cancelable: true}));},20));' ;
246+
241247 return chrome . tabs . executeScript ( r . tab . id , {
242- code : 'document.activeElement.value = ' + JSON . stringify ( pass ) + '; document.activeElement.dispatchEvent(new Event("change", {bubbles: true, cancelable: true}));' ,
248+ code : code ,
243249 frameId : r . frameId ,
244250 matchAboutBlank : true
245251 } ) ;
0 commit comments