DOM actions helper

Convenience wrappers around the safe named DOM actions that the extension already exposes.
RTO_helpers Copy/paste ready Product-grade integration
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 on DOMContentLoaded
  • Depends on: RTO_form_api.js (and typically RTO_connector.js setting window.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.js

Data attributes

  • data-rto-action: read-block | highlight | close-tab
  • data-rto-tabKey (recommended) — tabKey of the controlled tab
  • data-rto-tabkey (legacy alias) — accepted too
  • data-rto-selector: remote selector (in the controlled tab)
  • data-rto-target: local selector (textarea) for read/write
  • data-rto-color: highlight color (optional)
  • data-rto-ms: highlight duration in ms (optional)
  • data-rto-dirty or data-rto-mark-dirty on 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>

Next