`Autofill()` is gone

In Autofill v11 (MV2) we used to be able to use a special function called Autofill() in JavaScript rules to execute other profiles. For example, to execute a profile with ID “c1” after a 4-second delay, you’d enter this as your JavaScript rule:

Autofill('c1', 4000);

You could even chain these commands, like this:

Autofill('c1', 4000);
// Do some automation
Autofill('c4', 1000);
// Do some automation
Autofill('c10', 2000);

After some testing today, I realized that this function no longer works in v12 (MV3) because of the way MV3 extensions work. In the new world, in the name of improved security, all user JavaScript codes are executed in a different “context” than other scripts that exist on the web page, so they have no access to Lightning Autofill’s Autofill() function.

I’m not sure how I’m going to replace this function yet, as it was very useful in a lot of situations. MV3 continues to annoy the hell out of me every day. 💢