This commit reintroduces OS.File into the osfile experiment on
older versions of Thunderbird, that do not yet include IOUtils.
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
+ }
};
}
};