| Top |
getCurrentExtension ();
Get the current xlet's Extension object. Can be called during module initialization or at runtime.
Usage in xlets: const Extension = imports.ui.extension; const Me = Extension.getCurrentExtension(); const MyModule = Me.imports.myModule;
xletRequire (string path);
DEPRECATED Use getCurrentExtension() to import local modules
Global require function for xlets. Supports:
Relative paths: './calendar' -> extension.imports.calendar
GI imports: 'gi.St' -> imports.gi.St
Cinnamon imports: 'ui.main' -> imports.ui.main
installXletImporter (Extension extension);
Install native importer for xlet by temporarily modifying the search path.
clearXletImportCache (Extension extension);
Clear import cache to allow reloading of the xlet. Clears all cached module properties from the xlet's sub-importer.
versionCheck (required,current);
Check if a component is compatible for an extension. required is an array, and at least one version must be lower than the current version. current must be in the format <major>.<minor>.<point>.<micro> <micro> is always ignored <point> is ignored if not specified (so you can target the whole release) <minor> and <major> must match Each target version must be at least <major> and <minor>
reloadExtension (string uuid,Extension.Type type);
Reloads an xlet. Useful when the source has changed.
findExtensionSubdirectory (Gio.File dir);
For extensions that are shipped with multiple versions in different directories, look for the largest available version that is less than or equal to the current running version. If no such version is found, the original directory is returned.