RTO_addRemoveDomain.js
Helper file documentation for
RTO_addRemoveDomain.js.Docs updated: 2026-03-24
Summary
Allow-list UI binder.
- Exports:
RTOAllowlistUI - Depends on:
RTO_domainList.js
What it is
UI binder for allow-list management. You provide selectors for your input/buttons; it wires clicks and renders the list. It reads the host on each click (so changing the input works without re-binding).
In 7.13.0, the add flow is intentionally visible: the helper shows an “awaiting confirmation” message, then only shows success after the master-tab approval really happened. The Add button is also locked during that pending request, so repeated local clicks do not create pointless double sends.
Download
Download RTO_addRemoveDomain.jsExample
Typical add flow: click Add on your page, confirm on the master tab, then the helper updates the message and the rendered list.
<input id="hostInput" value="example.com" />
<button id="btnAdd">Add</button>
<button id="btnCheck">Check</button>
<button id="btnRemove">Remove</button>
<div id="msg" style="display:none"></div>
<div id="listWrap" style="display:none">
<div id="list"></div>
</div>
<script src="../RTO_helpers/RTO_domainList.js"></script>
<script src="../RTO_helpers/RTO_addRemoveDomain.js"></script>
<script>
RTOAllowlistUI.bind({
hostInput: "#hostInput",
addBtn: "#btnAdd",
checkBtn: "#btnCheck",
removeBtn: "#btnRemove",
msgEl: "#msg",
listWrap: "#listWrap",
listEl: "#list"
});
</script>
Messages you should expect
The helper first shows
Confirmation requested on the master tab....
If the user approves, it shows Added.
If the request is refused or not approved, it shows Not added (cancelled or not approved).
For plugin-side limits or routing problems, it now shows clearer messages such as:
Request cancelled on the master tab.,
Too many allow-list requests were sent in a short time.,
Too many requests are pending right now. Please try again in a moment.,
or No master tab is available to confirm the request.
Config fields
hostInput: selector/element for the input that contains the host (recommended).host: fixed host string (fallback if you do not usehostInput).addBtn,checkBtn,removeBtn: selectors/elements for buttons.msgEl: selector/element where messages are shown.listWrapandlistEl: container + output element where the allow-list is rendered.