artoo.js ships with a variety of settings for you to adjust.
You can change the library’s settings either by changing them directly through JavaScript:
artoo.settings.debug = true;
// Or if you need to merge settings:
artoo.loadSettings({
debug: false
});
Or by specifying a precise configuration in a custom bookmarklet generated by artoo.js’ grunt task.
true
] : should the given script be evaluated when artoo is started?true
] : should artoo launch his initialization routine when loaded? If the routine is not automatically launched, you’ll have to do it yourself with artoo.init()
.true
] : should the given script be evaluated every time the bookmarklet is invoked in the page?false
] : should debug mode be activated.null
] : the url of a distant script to be injected and executed as soon as artoo is started.null
] : the string of a script to be executed through eval
as soon as artoo is started.false
] : should artoo be reloaded when injected more than once.artoo enables you to load some remote dependencies alongside jQuery when he is injected within a webpage.
Note that the injected dependencies will be injected safely into your webpage by checking whether they can be injected into the global scope or not.
To do so, just add an array of desired dependencies in the settings.
Example
Requesting the async library through a cdn.
{
"dependencies": [
{
"name": "async",
"url": "//cdnjs.cloudflare.com/ajax/libs/async/0.9.0/async.js",
"globals": ["async"]
}
]
}
Options
artoo.deps
.false
] : should the dependency be forced into the global scope?Usage
// Given we requested async
// If no conflicts occured
async.series(task);
// A conflict occured, dependencies are available through 'artoo.deps'
artoo.deps.async.series(task);
'%'
] : the delimiter to be used to wrap cache’s storage keys.true
] : should artoo starts to record instructions on his own?false
] : should artoo force jQuery injection?2.1.1
] : jQuery version to be injected.true
] : should artoo be able to log?true
] : should the logo be displayed on start?'local'
] : engine to use for artoo.store
. Either local
or session
.