Monster.DOM. ResourceManager

The ResourceManager is a singleton that manages all resources.

Constructor

new ResourceManager(options)

A Resource class

Parameters:
NameTypeDescription
optionsObject

throw {Error} unsupported document type

Since
  • 1.25.0
License
  • AGPLv3

Members

defaults

Properties
NameTypeDefaultDescription
documentHTMLDocumentdocument

Document

resourcesObject
Properties
NameTypeDefaultDescription
scriptsArray[

array with Monster.DOM.Resource.Script objects

stylesheetsArray[

array with Monster.DOM.Resource.Link.Stylesheet objects

dataArray[

array with Monster.DOM.Resource.Data objects

Methods

addData(url, Object|undefined}) → {Monster.DOM.ResourceManager}

Add Data Tag

.

Add Data Tag

Parameters:
NameTypeDescription
urlstring | URL
Object|undefined}

options

addScript(url, Object|undefined}) → {Monster.DOM.ResourceManager}

Add a script

.

Add a script

Parameters:
NameTypeDescription
urlstring | URL
Object|undefined}

options

addStylesheet(url, Object|undefined}) → {Monster.DOM.ResourceManager}

Add Stylesheet

.

Add Stylesheet

Parameters:
NameTypeDescription
urlstring | URL
Object|undefined}

options

See
  • Monster.DOM.Resource.Link.Stylesheet

available() → {Promise}

Check if available

.

Check if available

Throws:

unsupported resource definition

Type
Error
Returns:
Type: 
Promise

connect() → {Monster.DOM.ResourceManager}

Append Tags to DOM

.

Append Tags to DOM

Throws:

unsupported resource definition

Type
Error

getBaseURL()

Properties
NameTypeDescription
baseurlstring