From 01bf8454d06929dc16da0135299d25a1035fc39b Mon Sep 17 00:00:00 2001 From: Eyal Rozenberg Date: Mon, 29 Jul 2024 15:29:48 +0300 Subject: [PATCH] Fixes #128: Always relying on `globalThis.Services` existing. --- src/chrome/content/bidimailui-common.js | 2 +- src/chrome/content/bidimailui-composer.js | 2 +- src/chrome/content/bidimailui-editor.js | 2 +- src/chrome/content/bidimailui-messenger.js | 2 +- src/chrome/content/overlay-injectors/3pane.js | 2 +- src/chrome/content/overlay-injectors/messenger.js | 2 +- src/chrome/content/overlay-injectors/messengercompose.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/chrome/content/bidimailui-common.js b/src/chrome/content/bidimailui-common.js index b02069a1..47f628ee 100644 --- a/src/chrome/content/bidimailui-common.js +++ b/src/chrome/content/bidimailui-common.js @@ -1,5 +1,5 @@ const EXPORTED_SYMBOLS = [ "BiDiMailUI" ]; -var Services = globalThis.Services || ChromeUtils.importESModule("resource://gre/modules/Services.sys.mjs").Services; +var Services = globalThis.Services; const { XPCOMUtils } = ChromeUtils.importESModule("resource://gre/modules/XPCOMUtils.sys.mjs"); var BiDiMailUI = { }; diff --git a/src/chrome/content/bidimailui-composer.js b/src/chrome/content/bidimailui-composer.js index 55a91efb..56d5ee24 100644 --- a/src/chrome/content/bidimailui-composer.js +++ b/src/chrome/content/bidimailui-composer.js @@ -1,4 +1,4 @@ -var Services = globalThis.Services || ChromeUtils.importESModule("resource://gre/modules/Services.sys.mjs").Services; +var Services = globalThis.Services; var { MailServices } = ChromeUtils.importESModule("resource:///modules/MailServices.sys.mjs"); var { BiDiMailUI } = ChromeUtils.import("chrome://bidimailui/content/bidimailui-common.js"); diff --git a/src/chrome/content/bidimailui-editor.js b/src/chrome/content/bidimailui-editor.js index f5b734eb..38d135d5 100644 --- a/src/chrome/content/bidimailui-editor.js +++ b/src/chrome/content/bidimailui-editor.js @@ -1,4 +1,4 @@ -var Services = globalThis.Services || ChromeUtils.importESModule("resource://gre/modules/Services.sys.mjs").Services; +var Services = globalThis.Services; const { BiDiMailUI } = ChromeUtils.import("chrome://bidimailui/content/bidimailui-common.js"); BiDiMailUI.Editor = {}; diff --git a/src/chrome/content/bidimailui-messenger.js b/src/chrome/content/bidimailui-messenger.js index 77c351c2..cea51537 100644 --- a/src/chrome/content/bidimailui-messenger.js +++ b/src/chrome/content/bidimailui-messenger.js @@ -1,4 +1,4 @@ -var Services = globalThis.Services || ChromeUtils.importESModule("resource://gre/modules/Services.sys.mjs").Services; +var Services = globalThis.Services; var { BiDiMailUI } = ChromeUtils.import("chrome://bidimailui/content/bidimailui-common.js"); // This file constains UI and glue code only, calling diff --git a/src/chrome/content/overlay-injectors/3pane.js b/src/chrome/content/overlay-injectors/3pane.js index 54a9051b..26d70ed1 100644 --- a/src/chrome/content/overlay-injectors/3pane.js +++ b/src/chrome/content/overlay-injectors/3pane.js @@ -1,4 +1,4 @@ -var Services = globalThis.Services || ChromeUtils.importESModule("resource://gre/modules/Services.sys.mjs").Services; +var Services = globalThis.Services; var { BiDiMailUI } = ChromeUtils.import("chrome://bidimailui/content/bidimailui-common.js"); // Note: There are some duplicates with injections from messenger.js, as those are not (easily) accessible diff --git a/src/chrome/content/overlay-injectors/messenger.js b/src/chrome/content/overlay-injectors/messenger.js index 17c7ab9b..e73d340e 100644 --- a/src/chrome/content/overlay-injectors/messenger.js +++ b/src/chrome/content/overlay-injectors/messenger.js @@ -1,4 +1,4 @@ -var Services = globalThis.Services || ChromeUtils.importESModule("resource://gre/modules/Services.sys.mjs").Services; +var Services = globalThis.Services; var { BiDiMailUI } = ChromeUtils.import("chrome://bidimailui/content/bidimailui-common.js"); // Note: There are some duplicates with injections from 3pane.js, as those are not (easily) accessible diff --git a/src/chrome/content/overlay-injectors/messengercompose.js b/src/chrome/content/overlay-injectors/messengercompose.js index 43cd8fb2..a8e9164e 100644 --- a/src/chrome/content/overlay-injectors/messengercompose.js +++ b/src/chrome/content/overlay-injectors/messengercompose.js @@ -1,4 +1,4 @@ -var Services = globalThis.Services || ChromeUtils.importESModule("resource://gre/modules/Services.sys.mjs").Services; +var Services = globalThis.Services; var { BiDiMailUI } = ChromeUtils.import("chrome://bidimailui/content/bidimailui-common.js"); const debugInjection = false;