Favorites

Store and reuse URLs (useful for dashboards, admin pages, or common workflows).
Docs updated: 2026-03-24

Favorites API

Load RTO_favoritesList.js to get window.RTOFavorites:

  • RTOFavorites.list() → Promise<array>
  • RTOFavorites.add(url, label?) → extension response object
  • RTOFavorites.has(url) → Promise<boolean>
  • RTOFavorites.remove(url) → extension response object
Current behavior
Favorites are normalized and deduplicated by URL. If a label is available, it is kept with the favorite entry.
<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_connector.js"></script>
<script src="../RTO_helpers/RTO_favoritesList.js"></script>
<script>
(async function(){
  await RTOconnectOnce(1500);

  const url = "https://example.com/dashboard";

  const list = await RTOFavorites.list();
  console.log("favorites:", list);

  const addRes = await RTOFavorites.add(url, "Example dashboard");
  console.log("added?", addRes && addRes.ok !== false, addRes);

  const exists = await RTOFavorites.has(url);
  console.log("exists?", exists);

  const removeRes = await RTOFavorites.remove(url);
  console.log("removed?", removeRes && removeRes.ok !== false, removeRes);
})();
</script>

UI helper

Use RTO_addRemovefavorite.js to bind buttons + list rendering.

<!-- Markup -->
<input id="favUrl" value="https://example.com" />
<input id="favLabel" value="Example" />
<button id="favAdd">Add</button>
<button id="favCheck">Check</button>
<button id="favRemove">Remove</button>
<div id="favMsg" style="display:none"></div>

<div id="favListWrap" style="display:none">
  <h3>Favorites</h3>
  <ul id="favList"></ul>
</div>

<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_connector.js"></script>
<script src="../RTO_helpers/RTO_favoritesList.js"></script>
<script src="../RTO_helpers/RTO_addRemovefavorite.js"></script>
<script>
RTOconnectOnce(1500).then(function(){
  RTOFavoritesUI.bind({
    urlInput: "#favUrl",
    labelInput: "#favLabel",
    addBtn: "#favAdd",
    checkBtn: "#favCheck",
    removeBtn: "#favRemove",
    msgEl: "#favMsg",
    listWrap: "#favListWrap",
    listEl: "#favList"
  });
});
</script>

Notes

  • has() and hasCached() are URL-based checks.
  • The UI helper only shows Added or Removed after the real helper call succeeds.

Next