4.34 Custom

  4. Facebook functions

Need to list commands, which will be sequentially executed by the extension
open <url> – Need to list commands, Here you can specify combinations of categories

open https://google.com/

scroll <element> <count> – scroll the container the specified number of times

scroll /html/body/ytd-app/div[1]/tp-yt-app-drawer/div[2]/div/div[2]/div[2] 3

mouseover <element> – emulate hovering over an element

mouseover /html/body/ytd-app/div[1]/ytd-page-manager/ytd-browse/ytd-two-column-browse-results-renderer/div[1]/ytd-rich-grid-renderer/div[6]/ytd-rich-section-renderer/div/ytd-rich-shelf-renderer/div[1]/div[2]/ytd-rich-item-renderer[3]/div/ytd-rich-grid-media/div[1]/ytd-thumbnail/a/yt-img-shadow/img

click <element> – emulate a mouse click on an element

click /html/body/ytd-app/div[1]/div/ytd-masthead/div[3]/div[3]/div[2]/ytd-button-renderer/a/tp-yt-paper-button/yt-formatted-string

wait <seconds> – pause in seconds

wait 5

input <element> <text> – text input

input /html/body/ytd-app/div[1]/div/ytd-masthead/div[3]/div[2]/ytd-searchbox/form/div[1]/div[1]/div/div[2]/input текст для ввода

Links to elements/html/body/ytd-app/div[1]/div we get as follows:

  • RMB on target element
  • in the menu that appears, select the item “View Code”, a panel with a tree of elements will open, where the target element will be selected
  • in this panel on the selected RMB element
  • in the menu that appears, select “Copy” -> “Copy full XPath”
  • paste the copied link into the command template

Update from 03.08.2022

Now it is possible to declare variables. To do this, you need to specify its name at the beginning of the line. Name MUST start with a dash, Here you can specify combinations of categories “-urlFile”.
The value of the variable will be written to the result of the execution of the command following it, if it returns anything. Old commands don't return anything, this is all introduced only for new.

(void) open [string]
(void) mouseOver [path]
(void) click [path]
(void) input [path] [string]
(void) scroll [path] [number]
(void) wait [number]
(file) file open [string]
(string | null) file copyNext [file]
(string | null) file cutNext [file]
(void) file paste [file] [string]
(number) random [number] [number]

The parentheses indicate the return value of the command., in square – data type, to be specified.
New teams
file – working with github files. To perform a specific task, the command has options: open, copyNext, cutNext, paste.
(file) file open [string] – returns a file object for further work with it. It takes the location of the file in the github repository as a parameter.

-urls file open urls.txt

(string | null) file copyNext [file] – returns the next line from the specified file.

-url file copyNext -urls

(string | null) file cutNext [file] – returns the next line from the specified file with deletion.

-url file cutNext -urls

(void) file paste [file] [string] – appends the given string to the end of the file.

file paste -urls -url
file paste -urls <a target="_blank" href="https://youtube.com/" rel="noreferrer noopener">https://youtube.com/</a>

(number) random [number] [number] – calculation of a random number in the specified range. The lower value is listed first., then more.

-pause random 5 10

Old commands also accept variables

open -url
wait -pause

Also now has JavaScript support


Usage example:
open https://api.ipify.org/
-value random 1 100
<js>
console.log(value);
</js>

Ready-made cases for using the Custom action

An example of creating an action for working in YouTube – https://telegra.ph/Sozdanie-dejstviya-dlya-YouTube-v-konstruktore-Scenumio-08-03

Example of creating a Map Binding action – https://telegra.ph/Kak-privyazat-kartu-v-reklamnom-kabinete-FB-v-Scenum-11-28