Parameters

Public Methods

checkDomainName(domain) → {boolean}

Compares the given domain name against the hostname of the browser containing the game.
If the domain name is found it returns true.
You can specify a part of a domain, for example 'google' would match 'google.com', 'google.co.uk', etc.
Do not include 'http://' at the start.

Parameters

Name

Type

Description

domain

string

Returns

boolean
-

true if the given domain fragment can be found in the window.location.hostname

Returns

updateQueryString(key, value, redirect, url) → {string}

Updates a value on the Query String and returns it in full.
If the value doesn't already exist it is set.
If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string.
Optionally you can redirect to the new url, or just return it as a string.

Parameters

Name

Type

Description

key

string

The querystring key to update.

value

string

The new value to be set. If it already exists it will be replaced.

redirect

boolean

If true the browser will issue a redirect to the url with the new querystring.

url

string

The URL to modify. If none is given it uses window.location.href.

Returns

string
-

If redirect is false then the modified url and query string is returned.