utils._route

Type: object

Field Type Description
host str "defly.io"
params str Use _route.params['example'] !== null to check if ?example is present in the URL
path str "/"
url str "https://defly.io/"

utils.getAccountData

Type: Function

Retrieves the current account data.

utils.getAccountData().then((data) => {
    // Do something with data...
})

utils.getExtensionAccountData

Type: Function

Retrieves the current extension account data.

utils.getExtensionAccountData().then((data) => {
    // Do something with data...
})

utils.Config

Type: object

utils.Config.Cloud

Saves data to the cloud using the website's storage, making it accessible across different devices connected to the same DPU account.

.get()

Type: Function

Field Required Type Description
feature True str Feature name
key True str Variable name
callback False fn Called when the request completes

.set()

Type: Function

Field Required Type Description
feature True str Feature name
key True str Variable name
value True str Data to store
callback False fn Called when the request completes

utils.Config.Local

.get()

Type: Function

Field Required Type Description
key True str Variable name

.set()

Type: Function

Field Required Type Description
key True str Variable name
value True str Data to store

utils.applyStyles

Type: Function

Injects CSS into the page.

Field Required Type Description
styles True str CSS string to apply
id False str ID of the style element

utils.applyHTML

Type: Function

Injects HTML into the page.

Field Required Type Description
html True str HTML string to inject
location False str Selector path for the target element
id False str ID of the container element

utils.popup

Type: Function

Displays a popup with custom HTML content.

Field Required Type Description
id True str ID of the container element
html True str HTML content to display

utils.watchStyles

Type: Function

Watches a target element for style changes and fires a callback when they occur.

Field Required Type Description
element True HTMLInputElement Target element to watch
callback True fn Called when a style change is detected

utils.changeShowState

Type: Function

Cycles a target element through three visibility states: visible, 50% opacity, and hidden.

Field Required Type Description
element True HTMLInputElement Target element

utils.hexToHsl

Type: Function

Converts a hexadecimal color code to HSL.

Field Required Type Description
hex True str Hexadecimal color code

utils.hslToHex

Type: Function

Converts HSL values to a hexadecimal color code.

Field Required Type Description
h True int Hue
s True int Saturation
l True int Lightness

utils.files

Type: object


.downloader()

Type: Function

Downloads a file to the user's device.

Field Required Type Description
data True str File content
filename True str Name of the file
type True str File extension

new .uploader()

Type: class

Creates a new file uploader instance.

Field Required Type Description
id True str ID of the uploader instance
onchange True fn Callback fired on file selection
accept True str Accepted file types

utils.setNFS

Type: Function

Sets the allowed frame shift range.

Field Required Type Description
min True int Minimum frame shift
max False int Maximum frame shift

utils.isActiveTab

Type: Function

Returns a bool indicating whether the user is currently focused on the page.


utils.get1v1Players

Type: Function

Returns a list of player names in the current 1v1 match.


window.codertjp

Type: String

Returns the URL to codertjp. This may point to the dev site, a local instance, or the public site depending on the environment.