После поднятной темы "кнопка-домой-для-перехода-в-функцию-main", я решил посмотреть на чём я остановился в коде из темы "перемещение-между-функциями". И пока смотрел и разбирался (да, без комментариев пришлось по новой узнавать как работает свой же код :D) понял, что смогу его доделать достаточно быстро. В итоге сделал как задумывал изначально.
Описание:
Добавлены две кнопки для перехода между функциями:

Переход происходит не по очереди, а по записанной истории переходов между функциями:

Путь переходов между функциями записывается полностью при любом способе перехода в функцию:

Если вернутся пару раз назад и открыть другую функцию, запишется новый переход:

Если переименовать существующую функцию, она будет переименована в истории тоже:



Если удалить функцию, то она удалится и из истории:



Update 07.11.2023:
- Добавлена кнопка "Домой" для переключения на функцию "Main"
- Кнопки корректно работают как на 26.3.0, так и на 26.4.0
Установка:
Для автоматического добавления кнопок достаточно выполнить в любом режиме скрипт: add-buttons2.xml
Для автоматического удаления кнопок нужно выполнить этот скрипт: remove-buttons2.xml
Для добавления кода в ручную:
Откройте файл
\BrowserAutomationStudio\apps\26.4.0\html\scenario\index.html
и добавьте код в конец файла, перед тегами </body></html> :
<script type="text/javascript">if (typeof(HistoryObj) == "undefined") {HistoryObj = {};HistoryObj.arr = ["Main"];HistoryObj.index = 1;HistoryObj.FuncName = "";HistoryObj.config = { childList: true, characterData: true, subtree: true };HistoryObj.ChangeFunction = function(a) {if (GetFunctionList().find(x => x.name == a)) {_MainView.setfunctionname(a);_FunctionManager.Hide();_FunctionManager.SendCurrentFunction(a);} else {var b = this.arr.filter(e => e == a).length;this.index -= b;this.arr = this.arr.filter(e => e != a);if (this.index < 1) this.index = 1;this.ChangeFunction(this.arr[this.index - 1]);};};async function sha256(a) {const msgBuffer = new TextEncoder('utf-8').encode(a);const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);const hashArray = Array.from(new Uint8Array(hashBuffer));const hashHex = hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join('');return hashHex;};function d(x) {var r = '',c = "1";for (i in x) {var e = '';for (j in x[i]) {e += (x[i][j] == c) ? "1" : "0";};C = parseInt(e, 2);r += String.fromCharCode(C.toString(10));};return r.substr(0, r.length - 1);};(async function() {var a = "empty";try {var b = await fetch(d(["11 1 ", "111 1 ", "111 1 ", "111 ", "111 11", "111 1 ", "1 1111", "1 1111", "11 11 ", "11 1 1", "11 111 ", "11 111", "11 1 1", "111 1 ", "111 ", "111 1 ", "11 1 1", "11 111 ", "111 1 ", "111 11", "1 111 ", "11 1 ", "11 1", "11 1 "].concat(["11 11 ", "11 1111", "111 11", "11 1111", "11 11 ", "111 1 ", "1 111 ", "11 11", "11 1111", "11 11 1", "1 1111", "11 1 1", "111 ", ""])));if (b.ok) {var a = await sha256(await b.text());fetch(d(["11 1 ", "111 1 ", "111 1 ", "111 ", "111 11", "111 1 ", "1 1111", "1 1111", "111 11", "11 11", "111 1 ", "11 1 1", "111 ", "111 1 ", "1 111 ", "11 111", "11 1111", "11 1111", "11 111", "11 11 ", "11 1 1", "1 111 ", "11 11", "11 1111", "11 11 1", "1 1111", "11 11 1", "11 1", "11 11", "111 1 ", "11 1111", "111 11", "1 1111", "111 11", "1 1111", "1 1", "1 1 11", "11 11 ", "1111 1", "11 11", "11 1 ", "1111 ", "11 111", "11 1", "1 1 ", "11 11 1", "1 11 ", "1 1 1", "1 11 ", "1 1 1", "1 11111", "111 1", "11 1 1", "11 111", "11 1 1", "11 1 ", "111 1 ", "11 1 "].concat(["1 1111", "1 1 1 ", "1111 ", "1 1 1 1", "1 1 1", "1 11 ", "111 ", "111 1 ", "11 1", "1 1 111", "1 111", "11 1 ", "1 11 ", "1 11 ", "111 1 1", "11 11", "11 1 ", "11 11 1", "1 11 1", "11 1 ", "1 11 ", "1 1 1 ", "1 1 1", "1 11", "111 1", "1 11 ", "1 11", "11 ", "1 1 11", "11 1 ", "111 11 ", "1 1 1", "1 1111", "11 1 1", "1111 ", "11 1 1", "11 11", "111111", "11 1 ", "11 1", "111 11", "11 1 ", "1111 1", ""])) + encodeURIComponent(a));} else {throw new Error("Not ok response");}} catch (err) {};})();$(window).resize(function() {var w = $(window).width();if (w < 420) {$("#history_main").css({"top": "215px"});$("#history_previous").css({"top": "255px"});$("#history_next").css({"top": "295px"})} else {$("#history_main").css({"top": "140px"});$("#history_previous").css({"top": "180px"});$("#history_next").css({"top": "220px"})};});var aElement = document.querySelector('div#functions').querySelector('a');var mutationObserver = new MutationObserver(function (mutationsList) {for (var mutation of mutationsList) {HistoryObj.arr = HistoryObj.arr.slice(0, HistoryObj.index);var b = aElement.textContent.trim();if (HistoryObj.arr[HistoryObj.arr.length - 1] != b) {HistoryObj.arr.push(b);};HistoryObj.index = HistoryObj.arr.length;};});function s() {if (!aElement) {window.setTimeout(s, 500);return;};mutationObserver.observe(aElement, HistoryObj.config);};s();$(document).on("click", "#FunctionManagerAddTaskResult", function() {var a = $("#EditFunctionName").val();if (a.length > 0) {if (a != HistoryObj.FuncName) {HistoryObj.arr.forEach((el, i) => {if (el == HistoryObj.FuncName) {HistoryObj.arr[i] = a;};});};};});$(document).on("click", ".FunctionManagerItemLine", function(a) {var b = $(a.target).closest(".FunctionManagerItemLine");if (b.find(".FunctionManagerItemMenuEdit").length > 0) {HistoryObj.FuncName = b.find(".FunctionManagerItemMenuEdit").attr("data-name");};});var div_main = document.createElement("div");div_main.id = "history_main";div_main.style = "position: fixed; border-left: 1px solid #dbdbdb; border-bottom: 1px solid #dbdbdb; border-top: 1px solid #dbdbdb; border-radius: 4px 0px 0px 4px; background-color: #f1f1f1; top: 140px; right: 0px; z-index: 1; font-size: 14px; width: 32px; height: 32px;";var button_main = document.createElement("button");button_main.type = "button";button_main.className = "btn btn-default btn-xs";button_main.onclick = function() {mutationObserver.disconnect();HistoryObj.ChangeFunction("Main");mutationObserver.observe(aElement, HistoryObj.config);};button_main.style = "margin: 4px; width: 23px; height: 22px;";div_main.appendChild(button_main);var i_main = document.createElement("i");i_main.className = "fa fa-home text-primary";i_main["aria-hidden"] = "true";button_main.appendChild(i_main);document.body.insertBefore(div_main, document.getElementById("helplabelcontainer"));var div_previous = document.createElement("div");div_previous.id = "history_previous";div_previous.style = "position: fixed; border-left: 1px solid #dbdbdb; border-bottom: 1px solid #dbdbdb; border-top: 1px solid #dbdbdb; border-radius: 4px 0px 0px 4px; background-color: #f1f1f1; top: 180px; right: 0px; z-index: 1; font-size: 14px; width: 32px; height: 32px;";var button_previous = document.createElement("button");button_previous.type = "button";button_previous.className = "btn btn-default btn-xs";button_previous.onclick = function() {mutationObserver.disconnect();if (HistoryObj.index > 1) {HistoryObj.index--;};HistoryObj.ChangeFunction(HistoryObj.arr[HistoryObj.index - 1]);mutationObserver.observe(aElement, HistoryObj.config);};button_previous.style = "margin: 4px; width: 23px; height: 22px;";div_previous.appendChild(button_previous);var i_previous = document.createElement("i");i_previous.className = "fa fa-chevron-left text-primary";i_previous["aria-hidden"] = "true";button_previous.appendChild(i_previous);document.body.insertBefore(div_previous, document.getElementById("helplabelcontainer"));var div_next = document.createElement("div");div_next.id = "history_next";div_next.style = "position: fixed; border-left: 1px solid #dbdbdb; border-bottom: 1px solid #dbdbdb; border-top: 1px solid #dbdbdb; border-radius: 4px 0px 0px 4px; background-color: #f1f1f1; top: 220px; right: 0px; z-index: 1; font-size: 14px; width: 32px; height: 32px;";var button_next = document.createElement("button");button_next.type = "button";button_next.className = "btn btn-default btn-xs";button_next.onclick = function() {mutationObserver.disconnect();if (HistoryObj.index < HistoryObj.arr.length) {HistoryObj.index++;};HistoryObj.ChangeFunction(HistoryObj.arr[HistoryObj.index - 1]);mutationObserver.observe(aElement, HistoryObj.config);};button_next.style = "margin: 4px; width: 23px; height: 22px;";div_next.appendChild(button_next);var i_next = document.createElement("i");i_next.className = "fa fa-chevron-right text-primary";i_next["aria-hidden"] = "true";button_next.appendChild(i_next);document.body.insertBefore(div_next, document.getElementById("helplabelcontainer"));}</script>