{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ru/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"JavaScript на странице"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"javascript-на-странице","__idx":0},"children":["JavaScript на странице"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Тип узла: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["browser_injectJavaScript"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"назначение","__idx":1},"children":["Назначение"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Выполняет JavaScript на странице, когда действию нужен доступ к документу в браузере."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"настройки-в-настольном-клиенте","__idx":2},"children":["Настройки в настольном клиенте"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/inject-java-script.9c689498b6dcffb8a7b14e78bafdda313c402532c0e264f664dff533253a499a.0538f3a9.webp","alt":"Настройки узла «JavaScript на странице» в настольном клиенте"},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Снимок сделан в английском интерфейсе MoreLogin Desktop V2.73.101."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"входные-данные","__idx":3},"children":["Входные данные"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Эти поля указываются в ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.browserUi.inputs"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Поле"},"children":["Поле"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип или значения"},"children":["Тип или значения"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Обязательно по схеме"},"children":["Обязательно по схеме"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"По умолчанию при выполнении"},"children":["По умолчанию при выполнении"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание и ограничения"},"children":["Описание и ограничения"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["params"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array<",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]},">"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[]"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["params. Начальное значение в редакторе: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[]"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["content"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["—"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Внедряемый скрипт"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["outputFormat"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}," (поддерживает ссылки на переменные)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"type\":\"object\"}"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Формат выходных данных. Начальное значение в редакторе: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{\"type\":\"object\"}"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["executionTimeoutMs"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["WorkflowNumber"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3000"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Тайм-аут выполнения (ms); минимум после вычисления: 100; максимум после вычисления: 30000. Начальное значение в редакторе: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3000"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"требования-к-режимам-и-ограничения","__idx":4},"children":["Требования к режимам и ограничения"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Узел принимает только введённый скрипт. Значения передавайте явно через params. Константные параметры типа object/array должны быть допустимыми объектами/массивами JSON (проверяется при записи). Скрипт выполняется асинхронно на реальной странице с тайм-аутом выполнения 100–30000ms."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Код ошибки проверки: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["RPA_NODE_INPUT_INVALID"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ссылки-во-входных-данных","__idx":5},"children":["Ссылки во входных данных"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Поле"},"children":["Поле"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Допустимые формы"},"children":["Допустимые формы"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["params"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["literal"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["template"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["content"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["literal"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["template"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["outputFormat"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["literal"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["template"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["executionTimeoutMs"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["literal"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["numericExpression"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"выходные-данные","__idx":6},"children":["Выходные данные"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Поле выходных данных"},"children":["Поле выходных данных"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип или значения"},"children":["Тип или значения"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[\"null\",\"boolean\",\"number\",\"string\"]"]}," / array<",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["JSON"]},"> / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["object"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["injected"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ссылайтесь на опубликованные поля в виде ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["${nodeId.data.field}"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"пример-json","__idx":7},"children":["Пример JSON"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Полный объект узла для массива ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nodes"]}," сценария или для ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blocks"]}," другого узла."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"id\": \"page_info\",\n  \"type\": \"browser_injectJavaScript\",\n  \"data\": {\n    \"title\": \"Read the title and link count from the page\",\n    \"browserAction\": \"injectJavaScript\",\n    \"browserUi\": {\n      \"inputs\": {\n        \"params\": [],\n        \"content\": \"return { title: document.title, links: document.links.length };\",\n        \"outputFormat\": {\n          \"type\": \"object\"\n        },\n        \"executionTimeoutMs\": 3000\n      },\n      \"exception\": {\n        \"timeout\": 30000,\n        \"policy\": \"interrupt\"\n      }\n    }\n  }\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/ru/browser-rpa/nodes"},"children":["Назад к каталогу узлов"]}]}]},"headings":[{"value":"JavaScript на странице","id":"javascript-на-странице","depth":1},{"value":"Назначение","id":"назначение","depth":2},{"value":"Настройки в настольном клиенте","id":"настройки-в-настольном-клиенте","depth":2},{"value":"Входные данные","id":"входные-данные","depth":2},{"value":"Требования к режимам и ограничения","id":"требования-к-режимам-и-ограничения","depth":2},{"value":"Ссылки во входных данных","id":"ссылки-во-входных-данных","depth":2},{"value":"Выходные данные","id":"выходные-данные","depth":2},{"value":"Пример JSON","id":"пример-json","depth":2}],"frontmatter":{"seo":{"title":"JavaScript на странице"}},"lastModified":"2026-11-20T14:40:39.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ru/browser-rpa/nodes/data/inject-java-script","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}