DOM actions helper
Convenience wrappers around the safe named DOM actions that the extension already exposes.
Best for
Projects that want readable page-side DOM action calls instead of repeating payload shapes manually.
Load with
RTO_form_api.js first.
Works well with
The DOM automation reference and form helpers.
Summary
Button-driven read/write/highlight/close actions.
- Exports:
(none)— auto-binds onDOMContentLoaded - Depends on:
RTO_form_api.js(and typicallyRTO_connector.jssettingwindow.RTOconnected)
Safe DOM mode: v8.5.0 does not allow helper-driven rewriting of normal page HTML or non-editable text. Use ordinary visible editable form fields for writing values.
What it is
A button-driven helper for simple remote DOM workflows: read remote HTML into a local textarea, write it back, highlight a remote element, and close the controlled tab.
Download
Download RTO_DOM_actions.jsData attributes
data-rto-action:read-block|highlight|close-tabdata-rto-tabKey(recommended) — tabKey of the controlled tabdata-rto-tabkey(legacy alias) — accepted toodata-rto-selector: remote selector (in the controlled tab)data-rto-target: local selector (textarea) for read/writedata-rto-color: highlight color (optional)data-rto-ms: highlight duration in ms (optional)data-rto-dirtyordata-rto-mark-dirtyon a textarea: marks it dirty on input (optional)
Example
<textarea id="localHtml" data-rto-dirty="1" style="width:100%;height:160px"></textarea>
<button data-rto-action="read-block" data-rto-tabKey="app" data-rto-selector="#content" data-rto-target="#localHtml">
Read remote HTML
</button>
<button data-rto-action="write-block disabled" disabled in v8.5.0 safe DOM mode data-rto-tabKey="app" data-rto-selector="#content" data-rto-target="#localHtml">
Write remote HTML
</button>
<button data-rto-action="highlight" data-rto-tabKey="app" data-rto-selector="#content" data-rto-color="#ffeb3b" data-rto-ms="1200">
Highlight
</button>
<button data-rto-action="close-tab" data-rto-tabKey="app">
Close tab
</button>
<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_connector.js"></script>
<script src="../RTO_helpers/RTO_DOM_actions.js"></script>