Russia has attacked Ukraine. We stand with Ukraine.
Partial income from our applications goes to support Ukraine.

app.loshadki

OpenIn 4

Documentation - 07. JavaScript Editor for Apps

Table of content

Window

Window

Working with the Script Editor

You can configure a test URL to work with, and be able to Run the script to see the Result and Console Log output.

Examples

Depending on the type of the application you are editing and for which handler, you can find some examples in the menu list under the Script Editor.

Available objects

Using the JavaScript you can change the URL.

url object is available for the script.

With the properties:

  • fragement - everything after # (string)
  • host - hostname and port (string)
  • hostname - just a domain, hostname (string)
  • href - string representation of full url (string)
  • username - username (string)
  • password - password (string)
  • pathname - the path (string)
  • port - port (string)
  • protocol - scheme (string)
  • search - query of the url (string)
  • searchParams - object to work on url query (SearchParams)

SearchParams provides the object with the following methods

  • append(name, value) - append the search key value
  • delete(name) - delete all query items with the name
  • get(name) - get the first value of the query with name
  • getAll(name) - get all values as array of the query with name
  • has(name) - check if query has a key
  • set(name, value) - set the name and value for the search
  • keys() - get the array of all keys

Debugging

You can use console.log("test") to write to a console output.

Examples

  • Change scheme:
url.protocol = "music"
  • Remove search parameter:
url.searchParams.delete("utm")