From: Dirk Steinmetz Date: Fri, 11 Aug 2023 22:34:24 +0000 (+0200) Subject: osfile: add backward-compatibility with TB 102 X-Git-Url: https://git.generalsync.com/oss/thunderbird-experiments.git/commitdiff_plain osfile: add backward-compatibility with TB 102 This commit reintroduces OS.File into the osfile experiment on older versions of Thunderbird, that do not yet include IOUtils. --- diff --git a/experiments/osfile/parent.js b/experiments/osfile/parent.js index 054b107..51c81f7 100644 --- a/experiments/osfile/parent.js +++ b/experiments/osfile/parent.js @@ -1,8 +1,14 @@ var ex_osfile = class extends ExtensionCommon.ExtensionAPI { getAPI(context) { return { - // our API is a true subset of IOUtils, so we can be lazy: - ex_osfile: IOUtils + ex_osfile: { + read: ( + // Thunderbird 115 and later + globalThis.IOUtils + // Thunderbird 102 and earlier + || ChromeUtils.import("resource://gre/modules/osfile.jsm").OS.File + ).read + } }; } };