Extension: Cinnamon Javascript Reference Manual

## Extension Extension |

## Functions

| versionCheck ()
| versionLeq ()
| loadExtension ()
| unloadExtension ()
| reloadExtension ()
Gio.File | findExtensionSubdirectory ()

## Functions

### versionCheck ()

    versionCheck (required,
                  current);

Check if a component is compatible for an extension. `required` is an array, and at least one version must match. `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>

#### Parameters

required | an array of versions we're compatible with |
current | the version we have |

### versionLeq ()

    versionLeq (string   a,
                string   b);

#### Parameters

a | the first version |
b | the second version |

#### Returns

whether a <= b

### loadExtension ()

    loadExtension (string           uuid,
                   Extension.Type   type);

#### Parameters

uuid | uuid of xlet |
type | type of xlet |

### unloadExtension ()

    unloadExtension (string           uuid,
                     Extension.Type   type,
                     bool             deleteConfig);

#### Parameters

uuid | uuid of xlet |
type | type of xlet |
deleteConfig | delete also config files, defaults to true |

### reloadExtension ()

    reloadExtension (string           uuid,
                     Extension.Type   type);

Reloads an xlet. Useful when the source has changed.

#### Parameters

uuid | uuid of xlet |
type | type of xlet |

### findExtensionSubdirectory ()

    Gio.File
    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.

#### Parameters

dir | directory to search in |

#### Returns

directory object of the desired directory.