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.
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.
url object is available for the script.
With the properties:
fragement- everything after
host- hostname and port (
hostname- just a domain, hostname (
href- string representation of full url (
username- username (
password- password (
pathname- the path (
port- port (
protocol- scheme (
search- query of the url (
searchParams- object to work on url query (
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
You can use
console.log("test") to write to a console output.
- Change scheme:
url.protocol = "music"
- Remove search parameter: