Automation scripts
A script drives many identity tabs at once — for example, sign up 100 accounts, one per CSV row, each on its own proxy. Scripts are plain JavaScript files; no build step, no restart.
Scripts are included on plans with plugins. On a plan without them, chrome://pluralbrowser shows "Plugin Not Supported in this plan" with an Upgrade button.
1. Where scripts go#
On chrome://pluralbrowser click Open plugins folder and drop your .js file there. It is picked up immediately; edit the file and run it again to use the new version.
2. Running a script#
Click Open run console on chrome://pluralbrowser. Pick your script and press Run. The console shows:
- Tabs — one line per row: queued, opening, running (with the current step), finished, failed, proxy failed, or already finished successfully. Finished tabs close themselves after a short countdown; Close now and Keep open are on the line.
- Runs — every run, with Stop.
- Installed scripts — every script file, and why one failed to load if it did.
- Problems — errors from your scripts.
3. The shape of a script#
exports.plural_api = 1;
exports.plural_run = async (plural) => {
const rows = await plural.rows(); // every proxy row from chrome://pluralbrowser
await plural.run(rows, async (t, row) => { // one identity tab per row
await t.goto("https://site.example/signup");
await t.type("#email", t.column("email"));
await t.click("#continue");
});
};4. Batches#
Put these at the top of your script. Every Plural setting starts with PLURAL_ and is in capitals.
| setting | default | what it does |
|---|---|---|
PLURAL_BATCH_SIZE | all rows | how many tabs are open at once |
PLURAL_CONTINUOUS | false | true: as soon as one tab finishes, the next row opens. false: the whole batch finishes before the next batch opens |
PLURAL_BATCH_STAGGER_TIME | not set | spread the openings in a batch over this time, e.g. "20s". Not set = all at once |
PLURAL_RETRIES | 3 | how many times a failed row is retried |
PLURAL_RETRY_GAP | "30s" | wait between retries |
PLURAL_PROXY_RETRIES | 1 | retries when the proxy itself failed (bad login, expired, unreachable) |
PLURAL_AUTO_CLOSE_AFTER | "30s" | a finished tab closes itself after this |
exports.PLURAL_BATCH_SIZE = 10;
exports.PLURAL_CONTINUOUS = true;Results are kept. Each row's result is saved. Run the same script again and rows that already finished are skipped ("already finished successfully"). Call plural.resetRecords() in your script to start over. A failed tab stays open so you can look at it.
Opening many tabs at once uses a lot of memory — start with a small batch and increase it.
5. What a script can do#
Rows and tabs
| call | what it does |
|---|---|
plural.rows() | every proxy row (with or without a tab) |
plural.open(row) | opens an identity tab on a row and returns it |
plural.close(t) / t.close() | closes a tab now |
plural.tabs() | every identity tab currently open |
plural.run(rows, fn) | the batch runner above |
plural.log(...) | writes to the run console |
Reading your CSV — t.column("name") returns that column for the tab's row, exactly as in your file. t.column("email") and t.column("password") return the row's account.
Acting on the page
| call | what it does |
|---|---|
t.goto(url) | open a page |
t.click(selector) | click an element |
t.type(selector, text) | type into a field (clears it first) |
t.press("Enter") | press a key: Enter, Tab, Escape, Backspace |
t.select(selector, value) | choose an option in a dropdown |
t.scroll(selector) | scroll an element into view |
t.eval(fn, arg) | run your own JavaScript in the page (out of the page's sight) |
Waiting — always wait for the page before acting on it.
| call | what it does |
|---|---|
t.waitFor(selector, { state, waitMs }) | until an element is attached (default), visible, enabled, hidden or gone (detached) |
t.waitForUrl(part, { waitMs }) | until the address contains part (e.g. after submitting a form) |
t.waitQuiet() | until the page stops loading |
t.randomDelay(min, max) | a human pause, in milliseconds |
Reading the page — t.text(sel), t.texts(sel), t.value(sel), t.attr(sel, name), t.exists(sel), t.count(sel).
Reporting — t.status("waiting for SMS") shows the current step on the tab's console line; t.report({ key: value }) adds values to it.
Codes — t.mailCode() reads an email code; see Email and SMS codes.
6. Errors#
A step that fails throws an error with a name you can check, e.g. err.name === "PluralTimeout":
| name | meaning |
|---|---|
PluralTimeout | waited too long |
PluralNotFound | no element matches the selector |
PluralProxyDead | the proxy failed — err.proxyFailed is true when the proxy itself is at fault |
PluralNavigationFailed | the page did not load |
PluralStopped | you pressed Stop |
Inside plural.run you do not need to catch errors yourself: a failed row is retried, then marked failed, and the other rows carry on.
A full example (email code + SMS code, batches of 10) ships as 09-batch-signup.js in the examples.