RTO_tabsList.js

Helper file documentation for RTO_tabsList.js.
Docs updated: 2026-03-24

Summary

Normalized listTabs snapshot utilities.

  • Exports: RTOTabsList
  • Depends on: RTO_form_api.js (optional; falls back to postMessage)
  • Recommended: RTO_connector.js (sets window.RTOconnected)
  • Config: optional window.RTO_PAGE_ORIGIN (must match content.js)

What it is

A convenience wrapper around RTOForm.listTabs() that returns a normalized snapshot: { ok, items, byKey, ts }.

If the API is not present, it falls back to window.postMessage with a configurable origin.

Download

Download RTO_tabsList.js

Config

By default, the helper uses origin: "rto-page" for messages. You can override it globally:

<script>
window.RTO_PAGE_ORIGIN = "my-site"; // must match what content.js checks (msg.origin)
</script>

Example

<script>
window.RTO_PAGE_ORIGIN = "my-site";
</script>
<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_tabsList.js"></script>
<script>
RTOTabsList.requestNow(2500).then(function(snap){
  console.log("ok:", snap.ok, "source:", snap.source);
  console.log("items:", snap.items);
  console.log("byKey:", snap.byKey);
});
</script>
<script src="../RTO_helpers/RTO_form_api.js"></script>
<script>
RTOForm.listTabs({}, { "timeoutMs": 2500 }).then(function (res) {
  console.log("raw listTabs result:", res);
});
</script>

Next