Spider Monkey Panel
- Implemented via Mozilla SpiderMonkey engine (ESR68).
- Conformant with ECMAScript 2019 (with the exception of modules and some RegExp features).
- Has built-in ActiveX support (so
Microsoft.XMLHTTPcan be used for network access).
- Has various extensions for managing foobar2000 and interacting with WinAPI.
- Has no built-in web browser-specific objects: e.g. XMLHttpRequest, Web Workers API and etc.
Table of Contents
- API description
Foobar2000 and panel events are translated to callback invocations (see callbacks section for the full list), for example:
new track being playedevent from fb2k will invoke on_playback_new_track(new_track_handle) function from user script, if such function was defined.
panel's size has changed> on_size(width, height);
mouse moved> on_mouse_move(x, y, mask)
Note: for performance reasons it's advised to define only those callbacks that you actually need.
fb: functions for controlling foobar2000 and accessing it's data.
gdi: functions for working with graphics. Most of them are wrappers for Gdi and GdiPlus methods.
plman: functions for managing foobar2000 playlists.
console: has only one method
log, which is used for logging messages to foobar2000 console.
utils: various utility functions.
window: functions for working with the current SMP panel and accessing it's properties.
ActiveX support further expands the range of available features and allows for easy file-system and web access:
Microsoft.XMLHTTP: this object can be used in place of
XMLHttpRequestfor web access.
FileSystemObject: used for file-system access (see MSDN documentation).
var xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
SMP includes some samples which demonstrate it's API usage (see samples sub-folder of your
- samples/basic: basic short examples.
- samples/complete: feature complete and feature rich samples created by marc2003.
See samples/readme.md for more info.
- marc2003: original foo_jscript_panel, sample scripts and multiple contributions to this project.
- T.P. Wang: original WSH Panel Mod.
- #jsapi IRC channel: wouldn't make it through without them, love you guys!
Especially huge thanks to sfink and jonco, who spent literally tens of hours helping me!
- Respective authors of the code being used in this project.