Skip to main content Link Search Menu Expand Document (external link)

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 Block looks like this.

URL Pattern
Autofill Rule+

This is what the Map Block looks 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/..., and https://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 pattern is a regular expression, then it will be used to match against the current value of attribute.
  • If pattern is a quoted string, then the contents of the quoted string will be used to match against attribute.
  • If field is 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 Rule to fill an input element 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 current value of field before it’s the element is autofilled. Think of format as the body of a Javascript function that looks like this:

function format(field) {
  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' + field

The generated format function would have been:

function(field) { 
  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 it were used as an index (zero based).

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 Rule that would select the second option (assuming ccExpDateMonth === '02') would be:

id="month"; ccExpDateMonth; parseInt(field)-1

The generated format function 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 Blocks where 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 system is not checked.

To force particular fields to be filled using human mode.

human field[, field]* 

To force particular fields to be filled using machine mode.

machine field[, field]* 

where field is any profile field.

Here’s an example of a map block where the phone number and first name fields will be filled in using human mode but the last name field will use the default 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

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.

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.

firstName

This is everything up to the first space character of name.

If name is John Doe, firstName would be John.

lastName

This is the everything after the first space character of name.

If name is John Doe, lastName would be Doe.

notes

The notes assigned to the profile

name

The profile name.

passcode

The first unused passcode assigned to the tab.

password

The currently resolved password.

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 phoneNumber is 5551234567, phoneNumberAreaCode would be 555.

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 phoneNumber is 5551234567, phoneNumberLocal would be 5551234567.

phoneNumberLocalPrefix

This will be the local prefix of the phone number.

If phoneNumber is 5551234567, phoneNumberLocalPrefix would be 123.

phoneNumberLocalSuffix

This will be the local suffix of the phone number.

If phoneNumber is 5551234567, phoneNumberLocalSuffix would be 4567.

phoneNumberNational

This will be the national version of the phone number.

If phoneNumber is 5551234567, phoneNumberNational would be 555-123-4567.

smsCode

The currently resolved SMS code.

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 smsNumber is 5551234567, smsNumberAreaCode would be 555.

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 smsNumber is 5551234567, smsNumberLocal would be 5551234567.

smsNumberLocalPrefix

This will be the local prefix of the sms number.

If smsNumber is 5551234567, smsNumberLocalPrefix would be 123.

smsNumberLocalSuffix

This will be the local suffix of the sms number.

If smsNumber is 5551234567, smsNumberLocalSuffix would be 4567.

smsNumberNational

This will be the national version of the sms number.

If smsNumber is 5551234567, smsNumberNational would be 555-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.