RTO_openTab_button.js
Helper file documentation for
RTO_openTab_button.js.Docs updated: 2025-12-17
Summary
Bind buttons to open/navigate/focus a remote tab.
- Exports:
RTObindTabButtons - Depends on: RTO_form_api.js
- Uses data attributes:
data-rto-closed-text,data-rto-key,data-rto-open-focus,data-rto-open-text,data-rto-poll,data-rto-refresh-focus,data-rto-tabKey,data-rto-url,data-rto-when-open
What it is
Binds buttons and links to tab actions using data-rto-* attributes (no custom click handler required).
Download
Download RTO_openTab_button.jsData attributes
data-rto-url(required)data-rto-tabKeyordata-rto-key(required)data-rto-when-open:focus(focus existing tab) orrefresh(navigate to URL again, then focus)data-rto-open-focus:1to focus after openingdata-rto-refresh-focus:1to refresh URL (cache-bust) and focus when already opendata-rto-open-text,data-rto-closed-text: optional label switchingdata-rto-poll: polling interval ms for state updates (optional)
Example
<button
data-rto-url="https://example.com/billing"
data-rto-tabKey="billing"
data-rto-open-focus="1"
data-rto-when-open="focus"
>
Open billing
</button>
<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_openTab_button.js"></script>