OpenIn 4
Documentation - 07. JavaScript Editor for Apps
Table of content
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 valuedelete(name)
- delete all query items with the nameget(name)
- get the first value of the query with namegetAll(name)
- get all values as array of the query with namehas(name)
- check if query has a keyset(name, value)
- set the name and value for the searchkeys()
- 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")