@@ -183,33 +183,33 @@ function saveRecent(settings, login, remove = false) {
183
183
* Call injected code to fill the form
184
184
*
185
185
* @param object settings Settings object
186
- * @param object fillRequest Fill request details
186
+ * @param object request Request details
187
187
* @param boolean allFrames Dispatch to all frames
188
188
* @param boolean allowForeign Allow foreign-origin iframes
189
189
* @param boolean allowNoSecret Allow forms that don't contain a password field
190
190
* @return array list of filled fields
191
191
*/
192
- async function dispatchFill ( settings , fillRequest , allFrames , allowForeign , allowNoSecret ) {
193
- fillRequest = Object . assign ( deepCopy ( fillRequest ) , {
192
+ async function dispatchFill ( settings , request , allFrames , allowForeign , allowNoSecret ) {
193
+ request = Object . assign ( deepCopy ( request ) , {
194
194
allowForeign : allowForeign ,
195
195
allowNoSecret : allowNoSecret ,
196
196
foreignFills : settings . foreignFills [ settings . host ] || { }
197
197
} ) ;
198
198
199
- var perFrameFillResults = await chrome . tabs . executeScript ( settings . tab . id , {
199
+ let perFrameResults = await chrome . tabs . executeScript ( settings . tab . id , {
200
200
allFrames : allFrames ,
201
- code : `window.browserpass.fillLogin(${ JSON . stringify ( fillRequest ) } );`
201
+ code : `window.browserpass.fillLogin(${ JSON . stringify ( request ) } );`
202
202
} ) ;
203
203
204
204
// merge filled fields into a single array
205
- var filledFields = perFrameFillResults
205
+ let filledFields = perFrameResults
206
206
. reduce ( ( merged , frameResult ) => merged . concat ( frameResult . filledFields ) , [ ] )
207
207
. filter ( ( val , i , merged ) => merged . indexOf ( val ) === i ) ;
208
208
209
209
// if user answered a foreign-origin confirmation,
210
210
// store the answers in the settings
211
- var foreignFillsChanged = false ;
212
- for ( var frame of perFrameFillResults ) {
211
+ let foreignFillsChanged = false ;
212
+ for ( let frame of perFrameResults ) {
213
213
if ( typeof frame . foreignFill !== "undefined" ) {
214
214
if ( typeof settings . foreignFills [ settings . host ] === "undefined" ) {
215
215
settings . foreignFills [ settings . host ] = { } ;
@@ -228,21 +228,21 @@ async function dispatchFill(settings, fillRequest, allFrames, allowForeign, allo
228
228
/**
229
229
* Call injected code to focus or submit the form
230
230
*
231
- * @param object settings Settings object
232
- * @param object focusOrSubmitRequest Focus or submit request details
233
- * @param boolean allFrames Dispatch to all frames
234
- * @param boolean allowForeign Allow foreign-origin iframes
231
+ * @param object settings Settings object
232
+ * @param object request Request details
233
+ * @param boolean allFrames Dispatch to all frames
234
+ * @param boolean allowForeign Allow foreign-origin iframes
235
235
* @return void
236
236
*/
237
- async function dispatchFocusOrSubmit ( settings , focusOrSubmitRequest , allFrames , allowForeign ) {
238
- focusOrSubmitRequest = Object . assign ( deepCopy ( focusOrSubmitRequest ) , {
237
+ async function dispatchFocusOrSubmit ( settings , request , allFrames , allowForeign ) {
238
+ request = Object . assign ( deepCopy ( request ) , {
239
239
allowForeign : allowForeign ,
240
240
foreignFills : settings . foreignFills [ settings . host ] || { }
241
241
} ) ;
242
242
243
243
await chrome . tabs . executeScript ( settings . tab . id , {
244
244
allFrames : allFrames ,
245
- code : `window.browserpass.focusOrSubmit(${ JSON . stringify ( focusOrSubmitRequest ) } );`
245
+ code : `window.browserpass.focusOrSubmit(${ JSON . stringify ( request ) } );`
246
246
} ) ;
247
247
}
248
248
0 commit comments