It was possible to change circuit programmatically by using the codes below:
Cc["@torproject.org/domain-isolator;1"].getService(Ci.nsISupports).wrappedJSObject.newCircuitForDomain("domain.com");
or
domainIsolator = Cc["@torproject.org/domain-isolator;1"].getService(Ci.nsISupports).wrappedJSObject;
domainIsolator.newCircuitForDomain("domain.com");
Now the codes don’t work.
It is useful to change circuit programmatically in situations when “Domain 1” redirects to “Domain 2” because the “IP” is blocked, and when “New Circuit” button is triggered, the circuit for “Domain 2” is changed instead for “Domain 1”, thus, “Domain 1” will keep redirecting to “Domain 2” because “Domain 1” circuit was not changed.
____ [Update]: ____
I found the code below so far, but it works exactly the same way as “New Circuit” button:
TorDomainIsolator.newCircuitForBrowser(gBrowser);
The function above somewhere calls the function below:
this.#newCircuitForDomain(firstPartyDomain);
So I tried the function calls below (but none worked):
this.#newCircuitForDomain("doamin.com");
TorDomainIsolator.#newCircuitForDomain("doamin.com");
TorDomainIsolator.newCircuitForDomain("doamin.com");