Methods
-
clearInterval(timerID)
-
Parameters:
Name Type Description timerIDnumber -
clearTimeout(timerID)
-
Parameters:
Name Type Description timerIDnumber -
include(path, optionsopt)
-
Evaluates the script in file.
Similar to `eval(utils.ReadTextFile(path))`, but provides more features:
- Has `include guards` - script won't be evaluated a second time if it was evaluated before in the same panel.
- Has script caching - script file will be read only once from filesystem (even if it is included from different panels).
- Has better error reporting.
Note: when the relative `path` is used it will be searched in the following paths:
- `${current_package_path}/scripts/${path}`, if the panel uses a package script.
- `${current_script_path}/${path}`, if the script is not a top-level `in-memory` script.
- `${fb.ComponentPath}/${path}`, otherwise.Parameters:
Name Type Attributes Description pathstring Absolute or relative path to JavaScript file. optionsobject <optional>
Properties
Name Type Attributes Default Description always_evaluateboolean <optional>
false If true, evaluates the script even if it was included before. Example
Include sample from `foo_spider_monkey_panel`
include('samples/complete/properties.js') -
setInterval(func, delay, …func_args) → {number}
-
Parameters:
Name Type Attributes Description funcfunction delaynumber func_args* <repeatable>
Returns:
number -
setTimeout(func, delay, …func_args) → {number}
-
Parameters:
Name Type Attributes Description funcfunction delaynumber func_args* <repeatable>
Returns:
numberExample
// See `samples/basic/Timer.js`
Type Definitions
-
ArtPromiseResult
-
Properties:
Name Type Attributes Description imageGdiBitmap <nullable>
null on failure pathstring path to image file (or track file if image is embedded) -
float
-
-
JsMemoryStats
-
Return value of window.JsMemoryStats.
Properties:
Name Type Description MemoryUsagenumber Memory usage of the current panel (in bytes) TotalMemoryUsagenumber Total memory usage of all panels (in bytes) TotalMemoryLimitnumber Maximum allowed memory usage for the component (in bytes).
If the total memory usage exceeds this value, all panels will fail with OOM error. -
JsPackageDirs
-
Note: returned directories are not guaranteed to exist.
Properties:
Name Type Description Rootstring Root directory of the package Assetsstring Directory inside package folder that contains assets Scriptsstring Directory inside package folder that contains scripts Storagestring Persistent and unique directory inside foobar2000 profile folder that can be used to store runtime data (e.g. cache) -
JsPackageInfo
-
Return value of window.GetPackageInfo.
Properties:
Name Type Description Versionstring Package version DirectoriesJsPackageDirs Package directories -
ScriptInfo
-
Return value of window.ScriptInfo.
Note: package_id is only present when the panel script is a package.Properties:
Name Type Attributes Description Namestring Authorstring <optional>
Versionstring <optional>
PackageIdstring <optional>