Autofill Map File
The autofill map file tells Jancy how to perform autofill on sites with profile information when the default autofill rules don’t work.
You can access the autofill map file from the File menu (File -> Autofill Map...). If your OS prompts you for which editor to use, just select the text editor your most comfortable with. When you’re done editing the file, save it. Jancy will autoreload all yuor autofill rules.
- On Windows the autofill map file is located at
%appdata%\Jancy\autofill.map- On MacOS the autofill map file is locatd at
~/Library/Application Support/Jancy/autofill.map
The File Structure
The file is made up by zero or more Map Blocks and Comments.
The Map Block
An autofill map file is basically a sequence of user defined blocks called Map Blocks.
The format of a
Map Blocklooks like this.URL Pattern Autofill Rule+
This is what the
Map Blocklooks like for Seatgeek’s checkout page.url=https://seatgeek.com/checkout* name=billingaddress\.first_name; firstName name=billingaddress\.last_name; lastName name=billingaddress\.address1; address name=billingaddress\.city; city name=billingaddress\.state; state name=billingaddress\.zip; zip
URL Pattern
Each map block starts with a url definition. The url tells Jancy which URLs the following rules should be applied to.
url=<pattern>
The pattern accepts an asterisk as a wildcard character.
url=https://*ticketmaster.com*Would match
https://ticketmaster.com/, https://auth.ticketmaster.com/as/..., andhttps://checkout.ticketmaster.com/1f7ae845c....
Autofill Rule
After the URL Pattern comes 1 or more Autofill Rule definitions.
<attribute>=<pattern>; <field>[; <format>]
- attribute is an attribute on the HTML element that you’re trying to match (ie.
class,id,name, etc). - pattern can either be a regular expression or a quoted string.
- field is one of the Profile fields or a quoted string.
- format an optional value that lets you customize the value before an element is filled. See below.
If Jancy finds an input, textarea, or select element on the current page with an attribute of attribute whose current value matches pattern then Jancy will attempt to set the value of the element to the current value of field from the currently selected profile in the tab.
- If
patternis a regular expression, then it will be used to match against the current value ofattribute.- If
patternis a quoted string, then the contents of the quoted string will be used to match againstattribute.- If
fieldis a quoted string, then the contents of the quoted string will be used as the value to autofill
To autofill a checkbox (checking or unchecking), you would specify the Autofill Rule the same but instead of specifying one of the properties of an Autofill Profile object for the field value you would instead use one of the special built-in constants (true, 1, false, or 0) to control the checkmark status.
To autofill a radio element, you either specify the Autofill Rule the same as a checkbox by using one of the contants (i.e. true or 1) or you can also use a field from the profile. If you’re using the latter, the correct radio option will be selected by comparing the value assigned to the radio element to the field value. You may need to use a format in order to coerce the value of field into something that matches the value assigned to the radio element.
The
Autofill Ruleto fill aninputelement with the first name of the currently selected profile if the element was defined as:<input name="customer-first-name" />would be:
name=customer-first-name; firstName
Format
The format field on the Autofill Rule works differently depending on the type of HTML element being filled.
For input and textfield HTML elements the format field allows you modify the value of field before the element is autofilled.
As of Jancy 1.9.1, you also get access to all other fields below using the allFields variable.
Think of format as the body of a Javascript function that looks like this:
function format(field, allFields) {
return WHATEVER-YOU-TYPED-FOR-FORMAT
}
If the HTML for a credit card expiration year was defined as:
<input id="year" />The corresponding autofill rule that would autofill the field with the century prepended would be:
id="year"; ccExpDateYear; '20' + fieldThe generated
formatfunction would have been:function(field, allFields) { return '20' + field // field would be whatever the current value of ccExpDateYear is }
For select HTML elements, the format field can influence how Jancy finds the correct option. If you specify a format that coerces a field value to be a number and not a string, Jancy will assume you want to pick the option that corresponds to
If you’re trying to select the second option from a select element that’s been defined as:
<select id="month"> <option>Jan</option> <option>Feb</option> <option>Mar</option> ... </select>The corresponding
Autofill Rulethat would select the second option (assumingccExpDateMonth === '02') would be:id="month"; ccExpDateMonth; parseInt(field)-1The generated
formatfunction would have been:function(field) { return parseInt(field) - 1 // field would be whatever the current value of ccExpDateMonth is }
Including Other Map Blocks
To cut down on the duplication that would be required for websites that have the same rules but have different URLs, it’s possible for a Map Block to include the rules of one or more other Map Blocks with the use of the include keyword. The include keyword must come after a URL Pattern.
include URL
Here’s an example of two
Map Blockswhere the second block includes all the rules of the first block.url=https://somesite.com id=firstName; firstName id=lastName; lastName url=https://someothersite.com include https://somesite.com
Overriding Default Autofill Mode
It’s possible to override the default autofill mode on a field by field basis.
This option only works if
use the old autofill systemis not checked.
To force particular fields to be filled using
humanmode.human field[, field]*To force particular fields to be filled using
machinemode.machine field[, field]*where
fieldis anyprofile field.
Here’s an example of a map block where the phone number and first name fields will be filled in using
humanmode but the last name field will use thedefault autofill mode.url=https://somesite.com human phoneNumberLocal, firstName id=firstName; firstName id=lastName; lastName id=phoneNumber; phoneNumberLocal
The any Map Block
Jancy comes with a predefined Map Block affectionally called the “any” Map Block. The “any” block is used when autofill is invoked on any site where the URL of the tab doesn’t match any other Map Block. The “any” block attempts to define rules that adhere to the official autofill spec defined here plus some other common rules you’ll see on websites from time to time.
The “any” block is also automatically included in all custom Map Blocks. This makes it easier to define custom Map Blocks because you only have to define the rules for the HTML elements that the “any” block doesn’t cover.
If you’d prefer the “any” map block not to be included by your custom map block you can use the dont-include-any keyword in your block.
url=https://somesite.com dont-include-any id=firstName; firstName id=lastName; lastName
Shadow Roots
If the elements you’re trying to target are contained within a shadow root, you can use the traverse-shadow-doms keyword.
This option only works if
use the old autofill systemis checked.
url=https://somesite.com traverse-shadow-doms id=firstName; firstName id=lastName; lastName
Comments
Any lines that start with a ; are treated as a comment and are ignored.
Profile Fields
The following are the available fields that can be used in an Autofill Rule.
address
The profile address.
This will be the address line 1 if autofilling with a credit card that has an assigned address line 1.
address2
The profile address2.
This will be the address line 2 if autofilling with a credit card that has an assigned address line 2.
ccCVV
The credit card CVV
ccExpDate
The full credit card expiration date.
The format will be MM/YY.
ccExpDateMonth
The credit card expiration month.
The format will be MM.
ccExpDateYear
The credit card expiration year.
The format will be YY.
ccNote
The note associated with the credit card.
ccNumber
The credit card number.
This will be the credit card number without dashes.
ccNumberFormatted
The credit card number.
This will be the credit card number with dashes.
ccType
The credit card type.
Will be AMEX, Discover, MC, Visa, or Unknown.
city
The profile city.
This will be the city if autofilling with a credit card that has an assigned city.
country
The profile country.
Always US.
dob
The date of birth.
The format will be MM/DD/YYYY.
dobDay
The date of birth day.
The format will be DD.
dobMonth
The date of birth month.
The format will be MM.
dobYear
The date of birth year.
The format will be YYYY.
email
The profile email.
emailCode
The currently resolved email code.
emailCodeTimestamp
The timestamp recieved from the source when the email code was resolved.
free1
Info under “Free 1” column in profile CSV.
free2
Info under “Free 2” column in profile CSV.
free3
Info under “Free 3” column in profile CSV.
free4
Info under “Free 4” column in profile CSV.
free5
Info under “Free 5” column in profile CSV.
free6
Info under “Free 6” column in profile CSV.
free7
Info under “Free 7” column in profile CSV.
free8
Info under “Free 8” column in profile CSV.
free9
Info under “Free 9” column in profile CSV.
free10
Info under “Free 10” column in profile CSV.
firstName
This is everything up to the first space character of name.
If
nameisJohn Doe,firstNamewould beJohn.
lastName
This is everything after the first space character of name.
If
nameisJohn Doe,lastNamewould beDoe.
notes
The notes assigned to the profile
name
The profile name.
otherCode
The currently resolved other code.
otherCodeTimestamp
The timestamp recieved from the source when the other code was resolved.
passcode
The first unused passcode assigned to the tab.
password
The currently resolved password.
passwordTimestamp
The timestamp received from the source when the password was resolved.
phoneNumber
The full profile phone number.
This will be 11 digit number without dashes and includes the country code.
phoneNumberAreaCode
This will be the area code of the phone number.
If
phoneNumberis5551234567,phoneNumberAreaCodewould be555.
phoneNumberCountryCode
The country code of the phone number.
This will always be 1.
phoneNumberLocal
This will be the local version of the phone number.
If
phoneNumberis5551234567,phoneNumberLocalwould be5551234567.
phoneNumberLocalPrefix
This will be the local prefix of the phone number.
If
phoneNumberis5551234567,phoneNumberLocalPrefixwould be123.
phoneNumberLocalSuffix
This will be the local suffix of the phone number.
If
phoneNumberis5551234567,phoneNumberLocalSuffixwould be4567.
phoneNumberNational
This will be the national version of the phone number.
If
phoneNumberis5551234567,phoneNumberNationalwould be555-123-4567.
smsCode
The currently resolved SMS code.
smsCodeTimestamp
The timestamp received from the source when the SMS code was resolved.
smsNumber
The full profile SMS number.
This will be 11 digit number without dashes and includes the country code.
smsNumberAreaCode
This will be the area code of the SMS number.
If
smsNumberis5551234567,smsNumberAreaCodewould be555.
smsNumberCountryCode
The country code of the SMS number.
This will always be 1.
smsNumberLocal
This will be the local version of the SMS number.
If
smsNumberis5551234567,smsNumberLocalwould be5551234567.
smsNumberLocalPrefix
This will be the local prefix of the SMS number.
If
smsNumberis5551234567,smsNumberLocalPrefixwould be123.
smsNumberLocalSuffix
This will be the local suffix of the SMS number.
If
smsNumberis5551234567,smsNumberLocalSuffixwould be4567.
smsNumberNational
This will be the national version of the SMS number.
If
smsNumberis5551234567,smsNumberNationalwould be555-123-4567.
state
The profile state.
This will be the state if autofilling with a credit card that has an assigned state.
This will be the abbreviated version of the state.
stateName
The profile state.
This will be the state if autofilling with a credit card that has an assigned state.
This will be the non-abbreviated version of the state.
zip
The profile zip code.
This will be the zip code if autofilling with a credit card that has an assigned zip code.